Commit 0bb148d7 authored by 李驰骋's avatar 李驰骋

量产申请基础代码

parent 7285d0a6
import request from "@/utils/request";
// 查询打样申请列表
export function listProductionRequest(query) {
return request({
url: "/mes/pro/productionRequest/list",
method: "get",
params: query,
});
}
// 查询打样申请详细
export function getProductionRequest(productionRequestId) {
return request({
url: "/mes/pro/productionRequest/" + productionRequestId,
method: "get",
});
}
// 新增打样申请
export function addProductionRequest(data) {
return request({
url: "/mes/pro/productionRequest",
method: "post",
data: data,
});
}
// 修改打样申请
export function updateProductionRequest(data) {
return request({
url: "/mes/pro/productionRequest",
method: "put",
data: data,
});
}
// 删除打样申请
export function delProductionRequest(productionRequestId) {
return request({
url: "/mes/pro/productionRequest/" + productionRequestId,
method: "delete",
});
}
// 修改状态
export function dofinish(data) {
return request({
url: "/mes/pro/productionRequest/modifyState/",
method: "put",
data: data,
});
}
...@@ -289,14 +289,15 @@ export default { ...@@ -289,14 +289,15 @@ export default {
}, },
/**表单提交 */ /**表单提交 */
submitForm() { submitForm() {
let thisObj = this;
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.optType == 'add') { if (thisObj.optType == 'add') {
this.tableData.unshift({ ...this.form }); thisObj.tableData.unshift({ ...thisObj.form });
} else { } else {
this.tableData.splice(this.currentRowIdx, 1, this.form) thisObj.tableData.splice(thisObj.currentRowIdx, 1, thisObj.form)
} }
this.showFlag = false; thisObj.showFlag = false;
} }
}); });
}, },
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
v-show="showSearch" v-show="showSearch"
label-width="100px" label-width="100px"
> >
<el-form-item label="量产申请编码" prop="productionRequestCode"> <el-form-item label="产品名称" prop="itemName">
<el-input <el-input
v-model="queryParams.productionRequestCode" v-model="queryParams.itemName"
placeholder="请输入产品名称" placeholder="请输入产品名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="工艺路线ID" prop="routeId"> <el-form-item label="单据状态" prop="productionRequestStatus">
<el-select <el-select
v-model="queryParams.routeId" v-model="queryParams.productionRequestStatus"
clearable clearable
placeholder="请选择单据状态" placeholder="请选择单据状态"
> >
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择申请日期" placeholder="请选择申请日期"
> >
</el-date-picker>--> </el-date-picker>-->
<!-- </el-form-item> --> <!-- </el-form-item> -->
<el-form-item> <el-form-item>
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:pro:productiorequest:add']" v-hasPermi="['mes:pro:productionRequest:add']"
>新增</el-button >新增</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:pro:productiorequest:edit']" v-hasPermi="['mes:pro:productionRequest:edit']"
>修改</el-button >修改</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:pro:productiorequest:remove']" v-hasPermi="['mes:pro:productionRequest:remove']"
>删除</el-button >删除</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:pro:productiorequest:export']" v-hasPermi="['mes:pro:productionRequest:export']"
>导出</el-button >导出</el-button
> >
</el-col> </el-col>
<right-toolbar <right-toolbar
...@@ -116,41 +116,47 @@ ...@@ -116,41 +116,47 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="prototypeRequestList" :data="productionRequestList"
row-key="productionRequestId" row-key="productionRequestId"
default-expand-all default-expand-all
> >
<el-table-column label="量产申请单编码" width="180" prop="productionRequesCode"> <el-table-column label="量产申请单编码" width="180" prop="productionRequestCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['mes:pro:productiorequest:query']" v-hasPermi="['mes:pro:productionRequest:query']"
>{{ scope.row.productionRequesCode }}</el-button >{{ scope.row.productionRequestCode }}</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="工艺路线ID" label="工艺路线"
width="120" width="120"
align="center" align="center"
prop="routeId" prop="routeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品名称"
width="120"
align="center"
prop="itemName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="产品ID" align="center" prop="itemId">
</el-table-column>
<el-table-column <el-table-column
label="制造工厂ID" label="制造工厂"
width="200" width="200"
align="center" align="center"
prop="factoryId" hidden="hidden"
prop="factoryName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
label="仓库" label="仓库"
align="center" align="center"
prop="wareHouse" prop="warehouse"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
...@@ -162,53 +168,54 @@ ...@@ -162,53 +168,54 @@
label="是否要鞋图" label="是否要鞋图"
align="center" align="center"
prop="isNeedShoeImg" prop="isNeedShoeImg"
> <template slot-scope="scope"> :formatter="yesNoFmt"
<dict-tag />
:options="dict.type.sys_yes_no"
:value="scope.row.isNeedShoeImg"
/>
</template>
</el-table-column>
<el-table-column <el-table-column
label="是否附样品" label="是否附样品"
align="center" align="center"
prop="isNeedPrototype" prop="isNeedPrototype"
><template slot-scope="scope"> :formatter="yesNoFmt"
/>
<el-table-column label="唯一码产品" align="center" prop="isUniqueCode"
:formatter="yesNoFmt"/>
<el-table-column label="不考虑型体配色" align="center" prop="isConsiderColor"
:formatter="yesNoFmt"/>
<el-table-column label="是否禁用" align="center" prop="isDisabled"
:formatter="yesNoFmt"/>
<!-- <template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.isNeedShoeImg"
/>
</template> -->
<!-- <dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.isNeedPrototype"
/>
<dict-tag <dict-tag
:options="dict.type.sys_yes_no" :options="dict.type.sys_yes_no"
:value="scope.row.isNeedPrototype" :value="scope.row.isConsiderColor"
/> />
</template>
</el-table-column>
<el-table-column label="唯一码产品" align="center" prop="isUniqueCode" >
<template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.sys_yes_no" :options="dict.type.sys_yes_no"
:value="scope.row.isUniqueCode" :value="scope.row.enableFlag"
/> />
</template>
</el-table-column>
<el-table-column label="不考虑型体配色" align="center" prop="isConsiderColor" >
<template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.sys_yes_no" :options="dict.type.sys_yes_no"
:value="scope.row.isConsiderColor" :value="scope.row.isDisabled" -->
/> />
</template> <el-table-column
</el-table-column> label="申请单状态"
<el-table-column label="是否禁用" align="center" prop="isDisabled" > align="center"
prop="prototypeRequestStatus"
>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.sys_yes_no" :options="dict.type.mes_productionreq_status"
:value="scope.row.isDisabled" :value="scope.row.productionRequestStatus"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="200px" width="200px"
...@@ -220,36 +227,36 @@ ...@@ -220,36 +227,36 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-if="scope.row.prototypeRequestStatus == '0'" v-if="scope.row.productionRequestStatus == '0'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:productiorequest:edit']" v-hasPermi="['mes:pro:productionRequest:edit']"
>修改</el-button >修改</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-circle-check" icon="el-icon-circle-check"
v-if="scope.row.prototypeRequestStatus == '0'" v-if="scope.row.productionRequestStatus == '0'"
@click="handleFinish(scope.row)" @click="handleFinish(scope.row)"
v-hasPermi="['mes:pro:productiorequest:update']" v-hasPermi="['mes:pro:productionRequest:update']"
>通过</el-button >通过</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:productiorequest:remove']" v-hasPermi="['mes:pro:productionRequest:remove']"
>删除</el-button >删除</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-if="scope.row.prototypeRequestStatus == '1'" v-if="scope.row.productionRequestStatus == '1'"
@click="generate(scope.row)" @click="generate(scope.row)"
v-hasPermi="['mes:pro:productiorequest:edit']" v-hasPermi="['mes:pro:productionRequest:edit']"
>生成制作单</el-button >生成制作单</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -265,238 +272,247 @@ ...@@ -265,238 +272,247 @@
</template> </template>
<script> <script>
import { import {
listPrototypeRequest, listProductionRequest,
getPrototypeRequest, getProductionRequest,
delPrototypeRequest, delProductionRequest,
addPrototypeRequest, addProductionRequest,
updatePrototypeRequest, updateProductionRequest,
dofinish, dofinish,
} from "@/api/mes/pro/prototypeRequest"; } from "@/api/mes/pro/productionRequest";
import ItemSelect from "@/components/itemSelect/single.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ClientSelect from "@/components/clientSelect/single.vue";
import ClientSelect from "@/components/clientSelect/single.vue"; import VendorSelect from "@/components/vendorSelect/single.vue";
import VendorSelect from "@/components/vendorSelect/single.vue"; import Treeselect from "@riophae/vue-treeselect";
import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "PrototypeRequest",
dicts: [
"sys_yes_no",
"mes_pr_status",
"mes_prototypeRequest_sourcetype",
"mes_prototypeRequest_type",
],
components: {
Treeselect,
ItemSelect,
ClientSelect,
VendorSelect,
},
data() {
return {
//自动生成编码
autoGenFlag: false,
optType: undefined,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 显示搜索条件
showSearch: true,
// 非单个禁用
single: true,
// 总条数
total: 0,
// 非多个禁用
multiple: true,
// 生产工单表格数据
prototypeRequestList: [],
// 生产工单树选项
prototypeRequestOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
productionRequestCode: null,
routeId: null,
},
options: [
{ value: 0, label: "审批中" },
{ value: 1, label: "待制作" },
{ value: 2, label: "打样中" },
{ value: 3, label: "待质检" },
{ value: 4, label: "待确认" },
{ value: 5, label: "已完成" },
],
// 表单参数 export default {
form: {}, name: "ProductionRequest",
// 表单校验 dicts: [
rules: { "sys_yes_no",
// prototypeRequestCode: [ "mes_productionreq_status",
// { required: true, message: "工单编码不能为空", trigger: "blur" } "mes_productionRequest_sourcetype",
// ], "mes_productionRequest_type",
}, ],
}; components: {
}, Treeselect,
created() { ItemSelect,
this.getList(); ClientSelect,
}, VendorSelect,
methods: {
/** 查询生产工单列表 */
getList() {
this.loading = true;
listPrototypeRequest(this.queryParams).then((response) => {
this.prototypeRequestList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
}, },
// 表单重置 data() {
reset() { return {
this.form = { //自动生成编码
productionRequestId: null, autoGenFlag: false,
productionRequestCode: null, optType: undefined,
routeId: null, // 遮罩层
productId: null, loading: true,
factoryId: null, // 选中数组
warehouse: null, ids: [],
sizeGroup: null, // 显示搜索条件
isNeedShoeImg: null, showSearch: true,
isNeedPrototype: null, // 非单个禁用
isUniqueCode: null, single: true,
isConsiderColor: null, // 总条数
isDisabled: null, total: 0,
shoeImg: null, // 非多个禁用
prototype: null, multiple: true,
remark: null, // 生产工单表格数据
createBy: null, productionRequestList: [],
createTime: null, // 生产工单树选项
updateBy: null, productionRequestOptions: [],
updateTime: null, // 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: null, // 可以查简称与英文名
productionRequestStatus: null,
},
options: [
{ value: 0, label: "审批中" },
{ value: 1, label: "待制作" },
{ value: 2, label: "量产中" },
{ value: 3, label: "待质检" },
{ value: 4, label: "待确认" },
{ value: 5, label: "已完成" },
],
// 表单参数
form: {},
// 表单校验
rules: {
// productionRequestCode: [
// { required: true, message: "工单编码不能为空", trigger: "blur" }
// ],
},
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询生产工单列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
listProductionRequest(this.queryParams).then((response) => {
this.productionRequestList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
productionRequestId: null,
productionRequestCode: null,
itemId: null,
itemName: null,
routeId: null,
routeName: null,
abbreviation: null,
enName: null,
num: null,
type: null,
modality: null,
surfaceTreatment: null,
ngReason: null,
plannedFinishDate: null,
plannedLayoutDate: null,
productionRequestStatus: "0",
testStandard: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
// 跳转到申请单界面
this.$router.push("/mes/proofing/apply");
return;
// this.reset();
// this.getTreeselect();
// if (row != null && row.productionRequestId) {
// this.form.parentId = row.productionRequestId;
// 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;
},
// 查询明细按钮操作
handleView(row) {
this.reset();
const productionRequestId = row.productionRequestId || this.ids;
this.$router.push(
"/mes/proofing/info?productionRequestId=" + productionRequestId
);
// getproductionRequest(productionRequestId).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = "查看工单信息";
// this.optType = "view";
// });
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const productionRequestId = row.productionRequestId || this.ids;
this.$router.push(
"/mes/pro/productiorequest/edit?productionRequestId=" + productionRequestId
);
// getProductionRequest(productionRequestId).then((response) => {
// // this.form = response.data;
// // this.open = true;
// // this.title = "修改生产工单";
// // this.optType="edit";
// // 跳转修改
// });
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除编号为"' + row.productionRequestId + '"的量产单?')
.then(function () {
return delProductionRequest(row.productionRequestId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true;
},
handleSelectClient() {
this.$refs.clientSelect.showFlag = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/productionRequest/export",
{
...this.queryParams,
},
`量产申请单_${new Date().getTime()}.xlsx`
);
},
// 审批
handleFinish(row) {
row.productionRequestStatus = 1
this.$modal
.confirm("确认通过样品申请单?一旦完成,此工单将无法继续修改")
.then(function () {
return dofinish(row); //完成申请单审批
})
.then(() => {
this.getList();
this.$modal.msgSuccess("审批成功");
})
.catch(() => {});
},
yesNoFmt(row, column, cellValue){
if(cellValue==1){
return '是';
}else{
return '否';
}
},
}, },
/** 新增按钮操作 */ // 生成制作单
handleAdd(row) { generate(row) {
// 跳转到申请单界面 // 跳转到制作单界面
this.$router.push("/mes/proofing/apply"); this.$router.push("/mes/proofing/apply");
return; return;
// this.reset();
// this.getTreeselect();
// if (row != null && row.prototypeRequestId) {
// this.form.parentId = row.prototypeRequestId;
// 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;
},
// 查询明细按钮操作
handleView(row) {
this.reset();
const productionRequestId = row.productionRequestId || this.ids;
this.$router.push(
"/mes/proofing/info?prototypeRequestId=" + prototypeRequestId
);
// getprototypeRequest(prototypeRequestId).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = "查看工单信息";
// this.optType = "view";
// });
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const productionRequestId = row.productionRequestId || this.ids;
this.$router.push(
"/mes/proofing/edit?productionRequestId=" + productionRequestId
);
// getPrototypeRequest(prototypeRequestId).then((response) => {
// // this.form = response.data;
// // this.open = true;
// // this.title = "修改生产工单";
// // this.optType="edit";
// // 跳转修改
// });
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除编号为"' + row.productionRequestId + '"的打样单?')
.then(function () {
return delPrototypeRequest(row.productionRequestId);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
handleSelectProduct() {
this.$refs.itemSelect.showFlag = true;
},
handleSelectClient() {
this.$refs.clientSelect.showFlag = true;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/prototypeRequest/export",
{
...this.queryParams,
},
`打样申请单_${new Date().getTime()}.xlsx`
);
},
// 审批
handleFinish(row) {
row.prototypeRequestStatus = 1
this.$modal
.confirm("确认通过样品申请单?一旦完成,此工单将无法继续修改")
.then(function () {
return dofinish(row); //完成申请单审批
})
.then(() => {
this.getList();
this.$modal.msgSuccess("审批成功");
})
.catch(() => {});
}, },
}, };
// 生成制作单
generate(row) {
// 跳转到制作单界面
this.$router.push("/mes/proofing/apply");
return;
},
};
</script> </script>
<template>
<div class="form-page" v-loading="loading">
<PageTitle>
{{ pageTitle }}
<!-- 申请按钮显示 -->
<template slot="buttons" v-if="mode == 'apply'">
<el-button size="mini" @click="resetForm">重置</el-button>
<el-button size="mini" type="primary" @click="saveForm">提交</el-button>
</template>
<!-- 修改 按钮显示 -->
<template slot="buttons" v-if="mode == 'edit'">
<el-button size="mini" type="primary" @click="saveForm">提交</el-button>
</template>
</PageTitle>
<PageWrapper>
<el-form
:model="form"
ref="form"
size="small"
:inline="true"
label-width="8em"
>
<el-row>
<el-col :md="8" :xs="12">
<el-form-item label="申请单编码" prop="productionRequestCode">
<el-input
disabled
v-model="form.productionRequestCode"
placeholder="自动生成"
></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12" style="height: 50.5px">
<el-form-item label="产品" prop="itemId">
<el-input
v-model="form.itemName"
readonly
placeholder="请选择产品"
>
<el-button
slot="append"
icon="el-icon-search"
@click="$refs['ItemSelectRef'].showFlag = true"
></el-button>
</el-input>
<ItemSelect ref="ItemSelectRef" @onSelected="onItemSelect" />
</el-form-item>
</el-col>
<el-col :md="8" :xs="12" style="height: 50.5px">
<el-form-item label="工艺路线" prop="routeId">
<el-input
v-model="form.routeName"
readonly
placeholder="请选择工艺路线"
>
<el-button
slot="append"
icon="el-icon-search"
@click="$refs['RoutesProcessSelectRef'].showFlag = true"
></el-button>
</el-input>
<RoutesProcessSelect
ref="RoutesProcessSelectRef"
@onSelected="onRoutesProcessSelect"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="8" :xs="12">
<el-form-item label="制造工厂" prop="factoryId">
<el-input
v-model="form.factoryName"
readonly
placeholder="请输入制造工厂"
>
<el-button
slot="append"
icon="el-icon-search"
@click="$refs['FactorySelectRef'].showFlag = true"
></el-button>
</el-input>
<FactorySelect
ref="FactorySelectRef"
@onSelected="onFactorySelect"
/>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="仓库" prop="warehouse">
<el-input
v-model="form.warehouse"
placeholder="请输入仓库"
></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="尺码" prop="sizeGroup">
<el-input
v-model="form.sizeGroup"
placeholder="请输入尺码"
></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="是否要鞋图" prop="isNeedShoeImg">
<el-select
v-model="form.isNeedShoeImg"
placeholder="请选择"
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="是否附样品" prop="isNeedPrototype">
<el-select
v-model="form.isNeedPrototype"
placeholder="请选择"
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="唯一码产品" prop="isUniqueCode">
<el-select
v-model="form.isUniqueCode"
placeholder="请选择"
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="不考虑型体配色" prop="isConsiderColor">
<el-select
v-model="form.isConsiderColor"
placeholder="请选择"
>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="鞋图" prop="shoeImg">
<el-input
v-model="form.shoeImg"
placeholder="请选鞋图"
></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :xs="12">
<el-form-item label="样品" prop="prototype">
<el-input
v-model="form.prototype"
placeholder="请选择样品"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="8" :xs="12">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="3"
v-model="form.remark"
placeholder="备注"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane label="BOM">
<ProogingBom ref="ProogingBomRef" />
</el-tab-pane>
<el-tab-pane label="工艺">
<ProogingProcess ref="ProogingProcessRef" :bomList="bomList" />
</el-tab-pane>
</el-tabs>
</PageWrapper>
</div>
</template>
<script>
import { genCode } from "@/api/system/autocode/rule";
import ProogingBom from "./components/ProogingBom.vue";
import ProogingProcess from "./components/ProogingProcess.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue";
import FactorySelect from "@/components/FactorySelect/index.vue";
import { listRouteprocess } from "@/api/mes/pro/routeprocess";
import tabPlugins from "@/plugins/tab";
import {
addProductionRequest,
getProductionRequest,
updateProductionRequest,
} from "@/api/mes/pro/productionRequest";
import {
getPrototypeMake
} from "@/api/mes/pro/prototypeMake";
export default {
components: { ProogingBom, ProogingProcess, ItemSelect, RoutesProcessSelect, FactorySelect },
dicts: [],
provide() {
return {
mode: this.mode,
};
},
data() {
return {
loading: false,
bomList: [],
// 表单参数
form: {
productionRequestCode: "",
itemId: "",
itemName: "",
unit: "",
routeId: "",
routeName: "",
factoryId:"",
factoryName:"",
type: "",
modality: "",
isNeedPrototype: "",
isNeedShoeImg: "",
isUniqueCode: "",
isDisabled:"",
shoeImg: "",
sizeGroup: "",
remark: "",
prototype:"",
warehouse: "",
},
rules: {},
};
},
computed: {
scrollHeight() {
return "calc(100vh - 73px - 83px)";
},
mode() {
return this.$route.path.split("/").at(-1);
},
pageTitle() {
const titles = {
edit: "量产单修改",
info: "量产单查看",
apply: "量产单申请",
};
return titles[this.mode];
},
},
created() {
this.getFormInfo();
this.gCode();
},
methods: {
/** 根据 id 获取页面数据 */
getFormInfo() {
if (this.mode == "apply" && this.$route.query.prototypeMakeId) {
const id = this.$route.query.prototypeMakeId;
this.loading = true;
getPrototypeMake(id)
.then(({ data }) => {
Object.assign(this.form, data);
this.bomList = data.bomList;
// 设置组件数据
this.$refs["ProogingBomRef"].tableData = data.bomList;
this.$refs["ProogingProcessRef"].tableData = data.processList;
})
.finally(() => {
this.loading = false;
});
}
},
/** 生成编码 */
gCode() {
genCode("PRODUCTION_REQUEST_CODE").then((response) => {
this.form.productionRequestCode = response;
});
},
/** 点击tab 获取bom的数据,将参数传递给后面的组件 */
tabClick(val) {
if (val.index != 0) {
this.bomList = this.$refs["ProogingBomRef"].getComData();
}
},
onItemSelect(row) {
if (row != undefined && row != null) {
this.form.itemId = row.itemId;
this.form.itemName = row.itemName;
this.form.unit = row.unitOfMeasure;
}
},
onRoutesProcessSelect(row) {
if (row != undefined && row != null) {
this.form.routeId = row.routeId;
this.form.routeName = row.routeName;
const params = {
pageNum: 1,
pageSize: 1000,
routeId: row.routeId,
};
listRouteprocess(params).then(({ rows }) => {
this.$refs["ProogingProcessRef"].setList(rows);
});
}
},
onFactorySelect(row) {
if (row != undefined && row != null) {
this.form.factoryId = row.factoryId;
this.form.factoryName = row.factoryName;
}
},
/**提交 */
saveForm() {
const bomList = this.$refs.ProogingBomRef.getComData();
const processList = this.$refs.ProogingProcessRef.getComData();
const params = {
...this.form,
bomList,
processList,
};
this.loading = true;
if (this.mode == "apply") {
addProductionRequest(params)
.then((res) => {
this.loading = false;
this.$modal.msgSuccess("提交成功!");
// 关闭页签
tabPlugins.closeOpenPage();
})
.catch(() => {
this.loading = false;
});
} else {
updateProductionRequest(params)
.then(() => {
this.loading = false;
this.$modal.msgSuccess("提交成功!");
})
.catch(() => {
this.loading = false;
});
}
},
/**重置表单 */
resetForm() {
this.form = {
productionRequestCode: "",
itemId: "",
itemName: "",
unit: "",
routeId: "",
routeName: "",
factoryId:"",
factoryName:"",
type: "",
modality: "",
isNeedPrototype: "",
isNeedShoeImg: "",
isUniqueCode: "",
isDisabled:"",
shoeImg: "",
sizeGroup: "",
remark: "",
prototype:"",
warehouse: "",
};
this.$refs["ProogingBomRef"].resetState();
this.$refs["ProogingProcessRef"].resetState();
this.gCode();
},
},
};
</script>
<style lang="scss" scoped></style>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
> >
<el-row> <el-row>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="量产申请单编码" prop="productionRequestCode"> <el-form-item label="申请单编码" prop="productionRequestCode">
<el-input <el-input
disabled disabled
v-model="form.productionRequestCode" v-model="form.productionRequestCode"
...@@ -70,88 +70,112 @@ ...@@ -70,88 +70,112 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12" style="height: 50.5px">
<el-form-item label="简称" prop="abbreviation"> <el-form-item label="制造工厂" prop="factoryId">
<el-input <el-input
v-model="form.abbreviation" v-model="form.factoryName"
placeholder="请输入简称" readonly
></el-input> placeholder="请选择工厂"
>
<el-button
slot="append"
icon="el-icon-search"
@click="$refs['FactorySelectRef'].showFlag = true"
></el-button>
</el-input>
<FactorySelect ref="FactorySelectRef" @onSelected="onFactorySelect" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="样品英文名" prop="enName"> <el-form-item label="仓库" prop="warehouse">
<el-input <el-input
v-model="form.enName" v-model="form.warehouse"
placeholder="请输入样品英文名称" placeholder="请输入仓库"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="样品数量" prop="num"> <el-form-item label="尺码" prop="sizeGroup">
<el-input v-model="form.num" placeholder="请输入样品数量"> <el-input
<template slot="suffix">{{ form.unit }}</template> v-model="form.sizeGroup"
</el-input> placeholder="请输入尺码"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="打样形式" prop="type"> <el-form-item label="是否要鞋图" prop="isNeedShoeImg">
<el-input <el-select
v-model="form.type" v-model="form.isNeedShoeImg"
placeholder="请选择打样形式" placeholder="请选择"
></el-input> >
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="分配方式" prop="modality"> <el-form-item label="是否附样品" prop="isNeedPrototype">
<el-input <el-select
v-model="form.modality" v-model="form.isNeedPrototype"
placeholder="请选择分配方式" placeholder="请选择"
></el-input> >
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="表面处理" prop="surfaceTreatment"> <el-form-item label="唯一码产品" prop="isUniqueCode">
<el-input <el-select
v-model="form.surfaceTreatment" v-model="form.isUniqueCode"
placeholder="请输入表面处理" placeholder="请选择"
></el-input> >
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="NG原因" prop="ngReason"> <el-form-item label="不考虑型体配色" prop="isConsiderColor">
<el-input <el-select
v-model="form.ngReason" v-model="form.isConsiderColor"
placeholder="请输入NG原因" placeholder="请选择"
></el-input> >
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="计划完成日期" prop="plannedFinishDate"> <el-form-item label="是否禁用" prop="isDisabled">
<el-date-picker <el-select
value-format="yyyy-MM-dd" v-model="form.isDisabled"
v-model="form.plannedFinishDate" placeholder="请选择"
placeholder="请输入计划完成日期" >
></el-date-picker> <el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="版面需求时间" prop="plannedLayoutDate"> <el-form-item label="鞋图" prop="shoeImg">
<el-date-picker <el-input
value-format="yyyy-MM-dd" v-model="form.shoeImg"
v-model="form.plannedLayoutDate" placeholder="请选鞋图"
placeholder="请输入版面需求时间" ></el-input>
></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="测试标准" prop="testStandard"> <el-form-item label="样品" prop="prototype">
<el-input <el-input
v-model="form.testStandard" v-model="form.prototype"
placeholder="测试标准" placeholder="请选择样品"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :md="8" :xs="12"> <el-col :md="8" :xs="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -183,17 +207,18 @@ import { genCode } from "@/api/system/autocode/rule"; ...@@ -183,17 +207,18 @@ import { genCode } from "@/api/system/autocode/rule";
import ProogingBom from "./components/ProogingBom.vue"; import ProogingBom from "./components/ProogingBom.vue";
import ProogingProcess from "./components/ProogingProcess.vue"; import ProogingProcess from "./components/ProogingProcess.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ItemSelect from "@/components/itemSelect/single.vue";
import FactorySelect from "@/components/FactorySelect/index.vue";
import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue"; import RoutesProcessSelect from "@/components/routesProcessSelect/index.vue";
import { listRouteprocess } from "@/api/mes/pro/routeprocess"; import { listRouteprocess } from "@/api/mes/pro/routeprocess";
import tabPlugins from "@/plugins/tab"; import tabPlugins from "@/plugins/tab";
import { import {
addPrototypeRequest, addProductionRequest,
getPrototypeRequest, getProductionRequest,
updatePrototypeRequest, updateProductionRequest,
} from "@/api/mes/pro/prototypeRequest"; } from "@/api/mes/pro/productionRequest";
export default { export default {
components: { ProogingBom, ProogingProcess, ItemSelect, RoutesProcessSelect }, components: { ProogingBom, ProogingProcess, ItemSelect, RoutesProcessSelect, FactorySelect },
dicts: [], dicts: [],
provide() { provide() {
return { return {
...@@ -207,17 +232,24 @@ export default { ...@@ -207,17 +232,24 @@ export default {
// 表单参数 // 表单参数
form: { form: {
productionRequestCode: "", productionRequestCode: "",
routeId: "",
itemId: "", itemId: "",
factoryId: "", itemName: "",
isNeedShoeImg: "", unit: "",
routeId: "",
routeName: "",
factoryId:"",
factoryName:"",
type: "",
modality: "",
isNeedPrototype: "", isNeedPrototype: "",
isNeedShoeImg: "",
isUniqueCode: "", isUniqueCode: "",
isConsiderColor: "", isDisabled:"",
isDisabled: "",
shoeImg: "", shoeImg: "",
prototype: "", sizeGroup: "",
remark: "", remark: "",
prototype:"",
warehouse: "",
}, },
rules: {}, rules: {},
}; };
...@@ -231,24 +263,23 @@ export default { ...@@ -231,24 +263,23 @@ export default {
}, },
pageTitle() { pageTitle() {
const titles = { const titles = {
edit: "打样单修改", edit: "量产单修改",
info: "打样单查看", info: "量产单查看",
apply: "打样单申请", apply: "量产单申请",
}; };
return titles[this.mode]; return titles[this.mode];
}, },
}, },
created() { created() {
this.getFormInfo(); this.getFormInfo();
this.gCode();
}, },
methods: { methods: {
/** 根据 id 获取页面数据 */ /** 根据 id 获取页面数据 */
getFormInfo() { getFormInfo() {
if (this.mode != "apply") { if (this.mode != "apply") {
const id = this.$route.query.prototypeRequestId; const id = this.$route.query.productionRequestId;
this.loading = true; this.loading = true;
getPrototypeRequest(id) getProductionRequest(id)
.then(({ data }) => { .then(({ data }) => {
Object.assign(this.form, data); Object.assign(this.form, data);
this.bomList = data.bomList; this.bomList = data.bomList;
...@@ -264,7 +295,7 @@ export default { ...@@ -264,7 +295,7 @@ export default {
/** 生成编码 */ /** 生成编码 */
gCode() { gCode() {
genCode("PROTOTYPE_REQUEST_CODE").then((response) => { genCode("PROTOTYPE_REQUEST_CODE").then((response) => {
this.form.prototypeRequestCode = response; this.form.productionRequestCode = response;
}); });
}, },
/** 点击tab 获取bom的数据,将参数传递给后面的组件 */ /** 点击tab 获取bom的数据,将参数传递给后面的组件 */
...@@ -280,6 +311,12 @@ export default { ...@@ -280,6 +311,12 @@ export default {
this.form.unit = row.unitOfMeasure; this.form.unit = row.unitOfMeasure;
} }
}, },
onFactorySelect(row) {
if (row != undefined && row != null) {
this.form.factoryId = row.factoryId;
this.form.factoryName = row.factoryName;
}
},
onRoutesProcessSelect(row) { onRoutesProcessSelect(row) {
if (row != undefined && row != null) { if (row != undefined && row != null) {
this.form.routeId = row.routeId; this.form.routeId = row.routeId;
...@@ -306,7 +343,7 @@ export default { ...@@ -306,7 +343,7 @@ export default {
}; };
this.loading = true; this.loading = true;
if (this.mode == "apply") { if (this.mode == "apply") {
addPrototypeRequest(params) addProductionRequest(params)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false;
this.$modal.msgSuccess("提交成功!"); this.$modal.msgSuccess("提交成功!");
...@@ -318,7 +355,7 @@ export default { ...@@ -318,7 +355,7 @@ export default {
this.loading = false; this.loading = false;
}); });
} else { } else {
updatePrototypeRequest(params) updateProductionRequest(params)
.then(() => { .then(() => {
this.loading = false; this.loading = false;
this.$modal.msgSuccess("提交成功!"); this.$modal.msgSuccess("提交成功!");
...@@ -331,22 +368,28 @@ export default { ...@@ -331,22 +368,28 @@ export default {
/**重置表单 */ /**重置表单 */
resetForm() { resetForm() {
this.form = { this.form = {
prototypeRequestCode: "", productionRequestCode: "",
routeId: "",
itemId: "", itemId: "",
factoryId: "", itemName: "",
isNeedShoeImg: "", unit: "",
routeId: "",
routeName: "",
factoryId:"",
factoryName:"",
type: "",
modality: "",
isNeedPrototype: "", isNeedPrototype: "",
isNeedShoeImg: "",
isUniqueCode: "", isUniqueCode: "",
isConsiderColor: "", isDisabled:"",
isDisabled: "",
shoeImg: "", shoeImg: "",
prototype: "", sizeGroup: "",
remark: "", remark: "",
prototype:"",
warehouse: "",
}; };
this.$refs["ProogingBomRef"].resetState(); this.$refs["ProogingBomRef"].resetState();
this.$refs["ProogingProcessRef"].resetState(); this.$refs["ProogingProcessRef"].resetState();
this.gCode();
}, },
}, },
}; };
......
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