|
@@ -12,10 +12,13 @@
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-form-item label="产品名称" prop="name">
|
|
|
- <el-input
|
|
|
- placeholder="请输入产品名称"
|
|
|
- v-model="screenForm.name"
|
|
|
- ></el-input>
|
|
|
+ <el-select placeholder="请选择产品品类" v-model="screenForm.name">
|
|
|
+ <el-option
|
|
|
+ v-for="item in materialLis"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
@@ -108,7 +111,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
- @click="(showDialogForm = true), (type = 1)"
|
|
|
+ @click="(showDialogForm = true), (type = 1), hanleMachine()"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
|
|
@@ -297,86 +300,64 @@
|
|
|
>
|
|
|
<el-form ref="form" :model="diaLogForm" label-width="100px">
|
|
|
<el-form-item label="产品名称">
|
|
|
- <!-- <el-select
|
|
|
- v-model="diaLogForm.positionName"
|
|
|
- multiple
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select> -->
|
|
|
- <el-input v-model="diaLogForm.storeName"></el-input>
|
|
|
+ <el-select placeholder="请选择产品品类" v-model="diaLogForm.materialId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in materialLis"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品型号">
|
|
|
<el-input v-model="diaLogForm.productModel"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="套机棉麻">
|
|
|
- <!-- <el-input v-model="diaLogForm.alert"></el-input> -->
|
|
|
+ <el-input v-model="diaLogForm.composeNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品体积">
|
|
|
<el-input v-model="diaLogForm.productVolume"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="内机编码">
|
|
|
- <el-select
|
|
|
- v-model="diaLogForm.positionName"
|
|
|
- multiple
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="diaLogForm.items" multiple placeholder="请选择">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in machineList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.innerMachineNumber"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="外机编码">
|
|
|
- <el-select
|
|
|
- v-model="diaLogForm.positionName"
|
|
|
- multiple
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="diaLogForm.items" multiple placeholder="请选择">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in machineList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.outsideMachineNumber"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="配件1">
|
|
|
- <el-select
|
|
|
- v-model="diaLogForm.positionName"
|
|
|
- multiple
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="diaLogForm.items" multiple placeholder="请选择">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in machineList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.parts1"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="配件2">
|
|
|
- <el-select
|
|
|
- v-model="diaLogForm.positionName"
|
|
|
- multiple
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="diaLogForm.items" multiple placeholder="请选择">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in machineList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.parts2"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -393,13 +374,15 @@
|
|
|
<script>
|
|
|
import Mixin from "@/mixin/index";
|
|
|
import { downloadFiles, handleImport } from "@/utils/util";
|
|
|
-
|
|
|
+// import { getDictList } from "@/api/common";
|
|
|
import {
|
|
|
getProductList,
|
|
|
getProductEdit,
|
|
|
getProductDetail,
|
|
|
getProductDel,
|
|
|
getProductAdd,
|
|
|
+ getMachineLlist,
|
|
|
+getMaterialList
|
|
|
} from "@/api/basic_data/material";
|
|
|
export default {
|
|
|
mixins: [Mixin],
|
|
@@ -431,16 +414,13 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
diaLogForm: {
|
|
|
+ adminCompanyId: null,
|
|
|
+ composeNumber: "",
|
|
|
id: null,
|
|
|
- composeNumber: "5464",
|
|
|
- items: [
|
|
|
- { id: "1", innerOutsideMachineId: "dfsf", parentId: "dsfs" },
|
|
|
- { id: "2", innerOutsideMachineId: "dfsf", parentId: "sdfdsf" },
|
|
|
- ],
|
|
|
- materialId: "454",
|
|
|
- orgNumber: 454,
|
|
|
- productModel: "5454545",
|
|
|
- productVolume: 2,
|
|
|
+ items: [],
|
|
|
+ materialId: null,
|
|
|
+ productModel: "",
|
|
|
+ productVolume: 0,
|
|
|
},
|
|
|
showDialogForm: false,
|
|
|
dataList: [
|
|
@@ -501,7 +481,7 @@ export default {
|
|
|
updateDate: "2022-09-12",
|
|
|
},
|
|
|
],
|
|
|
- searchForm: {
|
|
|
+ screenForm: {
|
|
|
innerName: "",
|
|
|
innerNumber: "",
|
|
|
innerType: "",
|
|
@@ -514,24 +494,45 @@ export default {
|
|
|
volume: "",
|
|
|
},
|
|
|
type: null,
|
|
|
+ machineList: [],
|
|
|
+ machinePei: {
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ name: "",
|
|
|
+ number: "",
|
|
|
+ type: "",
|
|
|
+ volume: "",
|
|
|
+ },
|
|
|
+ materialLis: {},
|
|
|
};
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ let params = {
|
|
|
+ pageNum:1,
|
|
|
+ pageSize: 410,
|
|
|
+ keyword: '',
|
|
|
+ };
|
|
|
+ getMaterialList(params).then((res) => {
|
|
|
+ this.materialLis = res.data.records;
|
|
|
+ console.log(this.materialLis,44444);
|
|
|
+ });
|
|
|
+ },
|
|
|
methods: {
|
|
|
getList() {
|
|
|
this.listLoading = true;
|
|
|
let params = {
|
|
|
pageNum: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
|
- innerName: this.searchForm.innerName,
|
|
|
- innerNumber: this.searchForm.innerNumber,
|
|
|
- innerType: this.searchForm.innerType,
|
|
|
- name: this.searchForm.name,
|
|
|
- number: this.searchForm.number,
|
|
|
- outsideName: this.searchForm.outsideName,
|
|
|
- outsideNumber: this.searchForm.outsideNumber,
|
|
|
- outsideType: this.searchForm.outsideType,
|
|
|
- type: this.searchForm.type,
|
|
|
- volume: this.searchForm.volume,
|
|
|
+ innerName: this.screenForm.innerName,
|
|
|
+ innerNumber: this.screenForm.innerNumber,
|
|
|
+ innerType: this.screenForm.innerType,
|
|
|
+ name: this.screenForm.name,
|
|
|
+ number: this.screenForm.number,
|
|
|
+ outsideName: this.screenForm.outsideName,
|
|
|
+ outsideNumber: this.screenForm.outsideNumber,
|
|
|
+ outsideType: this.screenForm.outsideType,
|
|
|
+ type: this.screenForm.type,
|
|
|
+ volume: this.screenForm.volume,
|
|
|
};
|
|
|
getProductList(params).then((res) => {
|
|
|
this.dataList = res.data.records;
|
|
@@ -540,57 +541,34 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
editFn(id, row) {
|
|
|
+ this.hanleMachine();
|
|
|
this.type = 2;
|
|
|
this.diaLogForm = {
|
|
|
+ ...this.diaLogForm,
|
|
|
id,
|
|
|
- composeNumber: row.composeNumber,
|
|
|
- items:
|
|
|
- row.items === undefined
|
|
|
- ? [
|
|
|
- { id: "1", innerOutsideMachineId: "df", parentId: "dsf" },
|
|
|
- { id: "2", innerOutsideMachineId: "ew", parentId: "wew" },
|
|
|
- ]
|
|
|
- : row.items,
|
|
|
+ adminCompanyId: row.adminCompanyId,
|
|
|
materialId: row.materialId,
|
|
|
- orgNumber: row.orgNumber,
|
|
|
- productModel: row.productModel,
|
|
|
- productVolume: row.productVolume,
|
|
|
- positionName: row.positionName,
|
|
|
};
|
|
|
|
|
|
this.showDialogForm = true;
|
|
|
},
|
|
|
hanleInfo() {
|
|
|
if (this.type === 1) {
|
|
|
+ this.diaLogForm.id = null;
|
|
|
+ this.diaLogForm.adminCompanyId = null;
|
|
|
|
|
|
- // {
|
|
|
-
|
|
|
- // }
|
|
|
- getProductAdd(this.diaLogForm).then((res) => {
|
|
|
+ const items = this.hanleForItem(this.diaLogForm.items);
|
|
|
+ getProductAdd({ ...this.diaLogForm, items }).then((res) => {
|
|
|
this.$successMsg("保存成功");
|
|
|
this.getList();
|
|
|
});
|
|
|
} else if (this.type === 2) {
|
|
|
- const params = {
|
|
|
- composeNumber: this.diaLogForm.composeNumber,
|
|
|
- id: this.diaLogForm.id,
|
|
|
- items: [
|
|
|
- {
|
|
|
- id: "445",
|
|
|
- innerOutsideMachineId: "4545",
|
|
|
- parentId: "4554",
|
|
|
- },
|
|
|
- ],
|
|
|
- materialId: this.diaLogForm.materialId,
|
|
|
- orgNumber: this.diaLogForm.orgNumber,
|
|
|
- productModel: this.diaLogForm.productModel,
|
|
|
- productVolume: this.diaLogForm.productVolume,
|
|
|
- };
|
|
|
+ const items = this.hanleForItem(this.diaLogForm.items);
|
|
|
+ const params = { ...this.diaLogForm, items };
|
|
|
getProductEdit(params).then((res) => {
|
|
|
this.$successMsg("编辑成功");
|
|
|
this.getList();
|
|
|
});
|
|
|
- this.diaLogForm.id = null;
|
|
|
}
|
|
|
|
|
|
this.showDialogForm = false;
|
|
@@ -623,6 +601,40 @@ export default {
|
|
|
productVolume: "",
|
|
|
};
|
|
|
},
|
|
|
+ hanleMachine() {
|
|
|
+ let params2 = {
|
|
|
+ pageNum: this.machinePei.currentPage,
|
|
|
+ pageSize: this.machinePei.pageSize,
|
|
|
+ name: this.machinePei.name,
|
|
|
+ number: this.machinePei.number,
|
|
|
+ type: this.machinePei.type,
|
|
|
+ volume: this.machinePei.volume,
|
|
|
+ };
|
|
|
+ getMachineLlist(params2).then((res) => {
|
|
|
+ this.machineList = res.data.records;
|
|
|
+ console.log(this.machineList, 1233);
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ pageNum:1,
|
|
|
+ pageSize: 410,
|
|
|
+ keyword: '',
|
|
|
+ };
|
|
|
+ getMaterialList(params).then((res) => {
|
|
|
+ this.materialLis = res.data.records;
|
|
|
+ console.log(this.materialLis,44444);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ hanleForItem(item) {
|
|
|
+ const items = [];
|
|
|
+ item.map((k) => {
|
|
|
+ return items.push({
|
|
|
+ id: "",
|
|
|
+ innerOutsideMachineId: k,
|
|
|
+ parentId: "",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return items;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|