Commit ffbdc0fe authored by tanjunxin's avatar tanjunxin

fix: 生产组合单追加生产单增加查询及表格优化

parent ffcce544
<template> <template>
<div class="app-container"> <div class="app-container" style="padding: 0">
<el-form
:model="queryParams"
@submit.native.prevent
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="工单编码" prop="workorderCode">
<el-input
v-model="queryParams.workorderCode"
placeholder="请输入工单编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
...@@ -11,12 +40,10 @@ ...@@ -11,12 +40,10 @@
:disabled="multiple" :disabled="multiple"
@click="handleCombination" @click="handleCombination"
v-hasPermi="['pro:combination:add']" v-hasPermi="['pro:combination:add']"
>追加到组合单 >追加到组合单
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="workorderList" :data="workorderList"
...@@ -25,15 +52,15 @@ ...@@ -25,15 +52,15 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
> >
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="工单编码" width="180" prop="workorderCode"/> <el-table-column label="工单编码" width="180" prop="workorderCode" />
<el-table-column <!-- <el-table-column
label="组合单号" label="组合单号"
width="180" width="180"
align="center" align="center"
prop="combinationCode" prop="combinationCode"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> /> -->
<el-table-column <el-table-column
label="工单名称" label="工单名称"
width="200" width="200"
...@@ -41,7 +68,7 @@ ...@@ -41,7 +68,7 @@
prop="workorderName" prop="workorderName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="工单来源" align="center" prop="orderSource"> <!-- <el-table-column label="工单来源" align="center" prop="orderSource">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.mes_workorder_sourcetype" :options="dict.type.mes_workorder_sourcetype"
...@@ -61,7 +88,7 @@ ...@@ -61,7 +88,7 @@
width="140" width="140"
align="center" align="center"
prop="sourceCode" prop="sourceCode"
/> /> -->
<el-table-column <el-table-column
label="产品编号" label="产品编号"
width="120" width="120"
...@@ -75,7 +102,7 @@ ...@@ -75,7 +102,7 @@
prop="productName" prop="productName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <!-- <el-table-column
label="规格型号" label="规格型号"
align="center" align="center"
prop="productSpc" prop="productSpc"
...@@ -108,7 +135,7 @@ ...@@ -108,7 +135,7 @@
align="center" align="center"
prop="clientName" prop="clientName"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> /> -->
<el-table-column <el-table-column
label="需求日期" label="需求日期"
align="center" align="center"
...@@ -119,14 +146,14 @@ ...@@ -119,14 +146,14 @@
<span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单据状态" align="center" prop="status"> <!-- <el-table-column label="单据状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:options="dict.type.mes_workorder_status" :options="dict.type.mes_workorder_status"
:value="scope.row.status" :value="scope.row.status"
/> />
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
...@@ -146,16 +173,16 @@ import { ...@@ -146,16 +173,16 @@ import {
addWorkorder, addWorkorder,
updateWorkorder, updateWorkorder,
dofinish, dofinish,
doCheckToolNum doCheckToolNum,
} from "@/api/mes/pro/workorder"; } from "@/api/mes/pro/workorder";
import {addProtaskList} from "@/api/mes/pro/protask"; import { addProtaskList } from "@/api/mes/pro/protask";
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 {genCode} from "@/api/system/autocode/rule"; import { genCode } from "@/api/system/autocode/rule";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getToken} from "@/utils/auth"; import { getToken } from "@/utils/auth";
import {batchAddCombination} from "@/api/mes/pro/combination"; import { batchAddCombination } from "@/api/mes/pro/combination";
export default { export default {
name: "chooseWorkorderForComb", name: "chooseWorkorderForComb",
...@@ -167,8 +194,8 @@ export default { ...@@ -167,8 +194,8 @@ export default {
props: { props: {
combinationCode: { combinationCode: {
type: String, type: String,
default: null default: null,
} },
}, },
components: { components: {
ItemSelect, ItemSelect,
...@@ -209,7 +236,7 @@ export default { ...@@ -209,7 +236,7 @@ export default {
// 是否更新已经存在的用户数据 // 是否更新已经存在的用户数据
updateSupport: 0, updateSupport: 0,
// 设置上传的请求头部 // 设置上传的请求头部
headers: {Authorization: "Bearer " + getToken()}, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData", url: process.env.VUE_APP_BASE_API + "/mes/pro/workorder/importData",
}, },
...@@ -244,31 +271,31 @@ export default { ...@@ -244,31 +271,31 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
workorderCode: [ workorderCode: [
{required: true, message: "工单编码不能为空", trigger: "blur"}, { required: true, message: "工单编码不能为空", trigger: "blur" },
], ],
workorderName: [ workorderName: [
{required: true, message: "工单名称不能为空", trigger: "blur"}, { required: true, message: "工单名称不能为空", trigger: "blur" },
], ],
workorderType: [ workorderType: [
{required: true, message: "请选择生产工单类型", trigger: "blur"}, { required: true, message: "请选择生产工单类型", trigger: "blur" },
], ],
orderSource: [ orderSource: [
{required: true, message: "来源类型不能为空", trigger: "blur"}, { required: true, message: "来源类型不能为空", trigger: "blur" },
], ],
productId: [ productId: [
{required: true, message: "产品不能为空", trigger: "blur"}, { required: true, message: "产品不能为空", trigger: "blur" },
], ],
productCode: [ productCode: [
{required: true, message: "产品编号不能为空", trigger: "blur"}, { required: true, message: "产品编号不能为空", trigger: "blur" },
], ],
productName: [ productName: [
{required: true, message: "产品名称不能为空", trigger: "blur"}, { required: true, message: "产品名称不能为空", trigger: "blur" },
], ],
quantity: [ quantity: [
{required: true, message: "生产数量不能为空", trigger: "blur"}, { required: true, message: "生产数量不能为空", trigger: "blur" },
], ],
requestDate: [ requestDate: [
{required: true, message: "需求日期不能为空", trigger: "blur"}, { required: true, message: "需求日期不能为空", trigger: "blur" },
], ],
}, },
}; };
...@@ -280,25 +307,27 @@ export default { ...@@ -280,25 +307,27 @@ export default {
async handleCombination() { async handleCombination() {
let params = { let params = {
combinationCode: this.combinationCode, combinationCode: this.combinationCode,
workorderList: [] workorderList: [],
} };
let shouldExit = false; let shouldExit = false;
this.selectedRows.forEach((item, index) => { this.selectedRows.forEach((item, index) => {
console.log(item); console.log(item);
if (item.combinationCode != '' && item.combinationCode != null) { if (item.combinationCode != "" && item.combinationCode != null) {
this.$modal.msgWarning(`${item.workorderCode}生产单已绑定组合单,不能再绑定!`); this.$modal.msgWarning(
shouldExit = true `${item.workorderCode}生产单已绑定组合单,不能再绑定!`
);
shouldExit = true;
} }
params["workorderList"].push({ params["workorderList"].push({
workorderId: item.workorderId, workorderId: item.workorderId,
workorderCode: item.workorderCode workorderCode: item.workorderCode,
}) });
}); });
if (!shouldExit) { if (!shouldExit) {
batchAddCombination(params).then(response => { batchAddCombination(params).then((response) => {
if(response.length == 0){ if (response.length == 0) {
this.$modal.msgWarning("不允许组合"); this.$modal.msgWarning("不允许组合");
}else { } else {
this.$modal.msgSuccess("追加组合单成功"); this.$modal.msgSuccess("追加组合单成功");
} }
this.getList(); this.getList();
...@@ -340,10 +369,10 @@ export default { ...@@ -340,10 +369,10 @@ export default {
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert( this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg + response.msg +
"</div>", "</div>",
"导入结果", "导入结果",
{dangerouslyUseHTMLString: true} { dangerouslyUseHTMLString: true }
); );
this.getList(); this.getList();
}, },
...@@ -472,7 +501,7 @@ export default { ...@@ -472,7 +501,7 @@ export default {
}, },
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row) { handleView(row) {
handleView handleView;
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
const workorderId = row.workorderId || this.ids; const workorderId = row.workorderId || this.ids;
...@@ -491,9 +520,9 @@ export default { ...@@ -491,9 +520,9 @@ export default {
handleSelectionChange(selection) { handleSelectionChange(selection) {
// this.selectedRows = val; // this.selectedRows = val;
this.selectedRows = selection; this.selectedRows = selection;
this.ids = selection.map(item => item.toolId) this.ids = selection.map((item) => item.toolId);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
// // 多选框选中数据 // // 多选框选中数据
// handleSelectionChange(selection) { // handleSelectionChange(selection) {
...@@ -555,8 +584,7 @@ export default { ...@@ -555,8 +584,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}) })
.catch(() => { .catch(() => {});
});
}, },
/** 生产任务单操作 */ /** 生产任务单操作 */
handleDofinish() { handleDofinish() {
...@@ -572,8 +600,7 @@ export default { ...@@ -572,8 +600,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("生成成功"); this.$modal.msgSuccess("生成成功");
}) })
.catch(() => { .catch(() => {});
});
}, },
handleToolNumCheck() { handleToolNumCheck() {
this.$modal this.$modal
...@@ -586,8 +613,7 @@ export default { ...@@ -586,8 +613,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("已齐套"); this.$modal.msgSuccess("已齐套");
}) })
.catch(() => { .catch(() => {});
});
}, },
handleSelectProduct() { handleSelectProduct() {
this.$refs.itemSelect.showFlag = true; this.$refs.itemSelect.showFlag = true;
...@@ -625,8 +651,7 @@ export default { ...@@ -625,8 +651,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("更改成功"); this.$modal.msgSuccess("更改成功");
}) })
.catch(() => { .catch(() => {});
});
}, },
// //物料选择弹出框 // //物料选择弹出框
// onItemSelected(obj){ // onItemSelected(obj){
...@@ -672,8 +697,7 @@ export default { ...@@ -672,8 +697,7 @@ export default {
this.getList(); this.getList();
this.$modal.msgSuccess("已确认成功"); this.$modal.msgSuccess("已确认成功");
}) })
.catch(() => { .catch(() => {});
});
}, },
//自动生成编码 //自动生成编码
handleAutoGenChange(autoGenFlag) { handleAutoGenChange(autoGenFlag) {
......
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