|
|
@@ -192,7 +192,7 @@
|
|
|
placeholder="请输入单位"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="工艺组合名称:">
|
|
|
+ <!-- <FormItem label="工艺组合名称:">
|
|
|
<Select
|
|
|
v-model="partsItem.processCombination"
|
|
|
size="small"
|
|
|
@@ -213,8 +213,8 @@
|
|
|
>
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label="工艺价格:">
|
|
|
+ </FormItem> -->
|
|
|
+ <!-- <FormItem label="工艺价格:">
|
|
|
<Input
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@@ -223,7 +223,7 @@
|
|
|
style="width: 150px"
|
|
|
placeholder="请输入工艺价格"
|
|
|
/>
|
|
|
- </FormItem>
|
|
|
+ </FormItem> -->
|
|
|
<FormItem label="高:">
|
|
|
<Input
|
|
|
type="text"
|
|
|
@@ -268,10 +268,45 @@
|
|
|
placeholder="请输入产值比"
|
|
|
/>
|
|
|
</FormItem>
|
|
|
+ <FormItem
|
|
|
+ v-for="item of partsItem.ProcessAttrList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="(item.name || item.title) + ':'"
|
|
|
+ >
|
|
|
+ <Select
|
|
|
+ v-model="item.selected_value"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :disabled="type == 2"
|
|
|
+ @on-change="(e) => handlePartsNameSelect(partsItem, e)"
|
|
|
+ style="width: 150px"
|
|
|
+ >
|
|
|
+ <OptionGroup
|
|
|
+ v-for="OptionGroup in item.cld"
|
|
|
+ :key="OptionGroup.type_title"
|
|
|
+ :label="OptionGroup.type_title"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="Option in OptionGroup.list"
|
|
|
+ :value="Option.id"
|
|
|
+ :key="Option.id"
|
|
|
+ >{{ Option.title }}</Option
|
|
|
+ >
|
|
|
+ </OptionGroup>
|
|
|
+ <Option
|
|
|
+ v-for="sitem in item.partsNameList"
|
|
|
+ :key="sitem.id"
|
|
|
+ :label="sitem.title"
|
|
|
+ :value="sitem.id"
|
|
|
+ >
|
|
|
+ </Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
</Form>
|
|
|
</div>
|
|
|
<div class="parts_content">
|
|
|
- <span>工艺属性:</span>
|
|
|
+ <!-- <span>工艺属性:</span>
|
|
|
<div
|
|
|
class="hierarchy"
|
|
|
v-for="(item, index) of partsItem.ProcessAttrList"
|
|
|
@@ -283,8 +318,6 @@
|
|
|
class="radio-g"
|
|
|
:key="_item.type_title"
|
|
|
>
|
|
|
- <!-- v-show="_item.display" -->
|
|
|
- <!-- v-show="_item.list && _item.list.length > 0" -->
|
|
|
<div class="tit_box">
|
|
|
<span :class="['box-us']" @click="setBoxChange(item, _item)">{{
|
|
|
_item.type_title
|
|
|
@@ -303,35 +336,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="radio-g">
|
|
|
- <div @click="setRadioChange(item, _item, index, partsItem)"
|
|
|
- :class="[
|
|
|
- 'radio-us',
|
|
|
- _item.show ? 'radio-us-foc' : '',
|
|
|
- _item.display ? 'radio-us-none' : '',
|
|
|
- ]"
|
|
|
- v-for="_item of item.cld"
|
|
|
- :key="_item.id">
|
|
|
- {{ _item.title }}
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- <div style="padding: 10px 0">
|
|
|
- <span>工艺路线:</span>
|
|
|
- <Tooltip max-width="200px">
|
|
|
- <div
|
|
|
- slot="content"
|
|
|
- v-show="!partsItem.isAddProcessRoute || type == 2"
|
|
|
- >
|
|
|
- 若要编辑工艺路线,请先选择或更改工艺组合
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <div style="display:flex;justify-content: space-between;">
|
|
|
+ <div style="padding: 10px 0">
|
|
|
+ <span>工艺路线:</span>
|
|
|
<Button
|
|
|
:disabled="!partsItem.isAddProcessRoute || type == 2"
|
|
|
@click="editRouter(partsItem, partsIndex)"
|
|
|
>选择工艺路线</Button
|
|
|
>
|
|
|
{{ partsItem.process_name }}
|
|
|
- </Tooltip>
|
|
|
+ </div>
|
|
|
+ <div style="padding: 10px 0">
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ @click="handleProcessLineShow(partsItem, partsIndex)"
|
|
|
+ >{{ partsItem.isShowProcessLine ? "收起" : "展开" }}</Button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="parts_content_lineTable">
|
|
|
@@ -340,18 +362,21 @@
|
|
|
border
|
|
|
:data="partsItem.partsProcessLineTableData"
|
|
|
>
|
|
|
- <!-- <template slot="processLineSet" slot-scope="{ row, index }">
|
|
|
- <a
|
|
|
- :style="
|
|
|
- type == 2
|
|
|
- ? 'margin: 0 5px; color: #ccc'
|
|
|
- : 'margin: 0 5px; color: red'
|
|
|
- "
|
|
|
- :disabled="!partsItem.isAddProcessRoute || type == 2"
|
|
|
- @click="handleProcessLineDele(row, index, partsIndex)"
|
|
|
- >删除</a
|
|
|
- >
|
|
|
- </template> -->
|
|
|
+ <template slot="timeSlot" slot-scope="{ row, index }">
|
|
|
+ <Input
|
|
|
+ v-model="partsItem.partsProcessLineTableData[index].time"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="wagesSlot" slot-scope="{ row, index }">
|
|
|
+ <Input
|
|
|
+ v-model="partsItem.partsProcessLineTableData[index].wages"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template slot="capacitySlot" slot-scope="{ row, index }">
|
|
|
+ <Input
|
|
|
+ v-model="partsItem.partsProcessLineTableData[index].capacity"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</Table>
|
|
|
</div>
|
|
|
<div class="parts_content_part">
|
|
|
@@ -618,7 +643,7 @@
|
|
|
<FormItem label="产品分类">
|
|
|
<el-cascader
|
|
|
clearable
|
|
|
- v-model="similarProductData.type_name"
|
|
|
+ v-model="similarProductData.type_id"
|
|
|
size="small"
|
|
|
style="width: 120px"
|
|
|
:show-all-levels="false"
|
|
|
@@ -626,12 +651,11 @@
|
|
|
:props="{
|
|
|
expandTrigger: 'hover',
|
|
|
children: 'child',
|
|
|
- value: 'title',
|
|
|
+ value: 'id',
|
|
|
label: 'title',
|
|
|
checkStrictly: true,
|
|
|
emitPath: false,
|
|
|
}"
|
|
|
- @change="(e) => hanndleAddPDTTypeChange(similarProductData, e)"
|
|
|
></el-cascader>
|
|
|
<!-- <Select
|
|
|
v-model="similarProductData.type_name"
|
|
|
@@ -1059,12 +1083,15 @@ export default {
|
|
|
processRouteName: "",
|
|
|
partsProcessLineColumns: [
|
|
|
{ title: "序号", type: "index", minWidth: 30, align: "center" },
|
|
|
- // { title: "工序分类", key: "type", align: "center" },
|
|
|
{ title: "工序名称", key: "title", align: "center" },
|
|
|
- { title: "工时", key: "time", align: "center" },
|
|
|
- { title: "工价", key: "wages", align: "center" },
|
|
|
- { title: "产能", key: "capacity", align: "center" },
|
|
|
- // { title: "操作", key: "set", align: "center", slot: "processLineSet" },
|
|
|
+ { title: "工时", key: "time", align: "center", slot: "timeSlot" },
|
|
|
+ { title: "工价", key: "wages", align: "center", slot: "wagesSlot" },
|
|
|
+ {
|
|
|
+ title: "产能",
|
|
|
+ key: "capacity",
|
|
|
+ align: "center",
|
|
|
+ slot: "capacitySlot",
|
|
|
+ },
|
|
|
], //工艺路线表头
|
|
|
partsPartColumns: [
|
|
|
{
|
|
|
@@ -1204,7 +1231,7 @@ export default {
|
|
|
ProcessAttrList: [], //工艺属性列表
|
|
|
partsList: [{ id: "", title: "" }], //部件分类名称列表
|
|
|
similarProductData: {
|
|
|
- type_name: "",
|
|
|
+ type_id: "",
|
|
|
title: "",
|
|
|
model: "",
|
|
|
url_number: "",
|
|
|
@@ -1350,17 +1377,17 @@ export default {
|
|
|
this.temp_info_bps = JSON.parse(JSON.stringify(this.info.bps));
|
|
|
});
|
|
|
this.axios("/api/bpp_list_new").then((res) => {
|
|
|
- res.data.map((v) => {
|
|
|
- if (v.select) {
|
|
|
- v.cld.map((z) => {
|
|
|
- v.select.map((k) => {
|
|
|
- z.show = k == z.id ? true : false;
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- v.cld.map((v) => (v.show = false));
|
|
|
- }
|
|
|
- });
|
|
|
+ // res.data.map((v) => {
|
|
|
+ // if (v.select) {
|
|
|
+ // v.cld.map((z) => {
|
|
|
+ // v.select.map((k) => {
|
|
|
+ // z.show = k == z.id ? true : false;
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // v.cld.map((v) => (v.show = false));
|
|
|
+ // }
|
|
|
+ // });
|
|
|
this.tempProcessAttrList = JSON.parse(JSON.stringify(res.data));
|
|
|
this.formData.parts.forEach((element) => {
|
|
|
element.ProcessAttrList = res.data;
|
|
|
@@ -1430,6 +1457,7 @@ export default {
|
|
|
process_price: "", //工艺价格
|
|
|
proportion: "", //产值比例
|
|
|
properties: [], //工艺属性
|
|
|
+ isShowProcessLine: true, //是否展示工艺路线
|
|
|
ProcessAttrList: JSON.parse(
|
|
|
JSON.stringify(this.tempProcessAttrList)
|
|
|
), //工艺属性列表
|
|
|
@@ -1537,13 +1565,13 @@ export default {
|
|
|
handleSimilarProductShow() {
|
|
|
this.showSimilarProductModal = true;
|
|
|
this.similarProductLoading = true;
|
|
|
- this.similarProductData.type_name = "";
|
|
|
+ this.similarProductData.type_id = "";
|
|
|
this.similarProductData.title = "";
|
|
|
this.similarProductData.model = "";
|
|
|
this.similarProductData.url_number = "";
|
|
|
this.axios("/api/product", {
|
|
|
params: {
|
|
|
- type_name: this.similarProductData.type_name,
|
|
|
+ type_id: this.similarProductData.type_id,
|
|
|
title: this.similarProductData.title,
|
|
|
model: this.similarProductData.model,
|
|
|
url_number: this.similarProductData.url_number,
|
|
|
@@ -1580,7 +1608,7 @@ export default {
|
|
|
this.similarProductLoading = true;
|
|
|
this.axios("/api/product", {
|
|
|
params: {
|
|
|
- type_name: this.similarProductData.type_name,
|
|
|
+ type_id: this.similarProductData.type_id,
|
|
|
title: this.similarProductData.title,
|
|
|
model: this.similarProductData.model,
|
|
|
url_number: this.similarProductData.url_number,
|
|
|
@@ -1640,6 +1668,7 @@ export default {
|
|
|
element.wide = element.formula_w;
|
|
|
element.thick = element.formula_h;
|
|
|
element.long = element.formula_l;
|
|
|
+ element.isShowProcessLine = true;
|
|
|
element.ProcessAttrList = JSON.parse(
|
|
|
JSON.stringify(this.tempProcessAttrList)
|
|
|
); //工艺属性列表
|
|
|
@@ -1858,6 +1887,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ handleProcessLineShow(item, index) {
|
|
|
+ item.isShowProcessLine
|
|
|
+ ? (document.getElementsByClassName("parts_content_lineTable")[
|
|
|
+ index
|
|
|
+ ].style.height = "89px")
|
|
|
+ : (document.getElementsByClassName("parts_content_lineTable")[
|
|
|
+ index
|
|
|
+ ].style.height = "auto");
|
|
|
+ item.isShowProcessLine = !item.isShowProcessLine;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
//选择工艺路线
|
|
|
editRouter(item, index) {
|
|
|
// 重新打开则重新判定是否为新增工艺路线
|
|
|
@@ -2163,13 +2203,6 @@ export default {
|
|
|
if (atfer_BJ_name.length != BJ_name.length) {
|
|
|
return this.$Message.error("部件名称存在重复");
|
|
|
}
|
|
|
- const GYLX_name = this.formData.parts.map((item) => {
|
|
|
- return item.processCombination;
|
|
|
- });
|
|
|
- const atfer_GYLX_name = Array.from(new Set(GYLX_name));
|
|
|
- if (GYLX_name.length != atfer_GYLX_name.length) {
|
|
|
- return this.$Message.error("工艺路线存在重复");
|
|
|
- }
|
|
|
if (sum != 100) {
|
|
|
this.$Message.error("产值比之和须为100");
|
|
|
} else {
|
|
|
@@ -2181,7 +2214,8 @@ export default {
|
|
|
element.partsNameList.forEach((ele) => {
|
|
|
if (element.part_id == ele.id && ele.id == ele.title) {
|
|
|
flag = true;
|
|
|
- }});
|
|
|
+ }
|
|
|
+ });
|
|
|
if (flag) {
|
|
|
let result = await this.axios({
|
|
|
method: "post",
|
|
|
@@ -2204,37 +2238,35 @@ export default {
|
|
|
if (result.code == 200) {
|
|
|
element.part_id = result.data.id;
|
|
|
// 工艺路线保存 partsProcessLineTableData
|
|
|
- let procedure = "";
|
|
|
- let bool = false;
|
|
|
- element.partsProcessRouteList.forEach((ele) => {
|
|
|
- if (
|
|
|
- element.processCombination == ele.id &&
|
|
|
- ele.id == ele.title
|
|
|
- ) {
|
|
|
- bool = true;
|
|
|
- }
|
|
|
- });
|
|
|
- element.partsProcessLineTableData.forEach(async (el, idx) => {
|
|
|
- if (idx == element.length - 1) {
|
|
|
- procedure += el.id + "";
|
|
|
- } else {
|
|
|
- procedure += el.id + ",";
|
|
|
- }
|
|
|
+ let bool = true;
|
|
|
+ // element.partsProcessRouteList.forEach((ele) => {
|
|
|
+ // if (
|
|
|
+ // element.processCombination == ele.id &&
|
|
|
+ // ele.id == ele.title
|
|
|
+ // ) {
|
|
|
+ // bool = true;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ let properties = element.ProcessAttrList.map((v) => {
|
|
|
+ return { type_id: v.type_id, value: v.selected_value };
|
|
|
});
|
|
|
+ // element.partsProcessLineTableData.forEach(async (el, idx) => {
|
|
|
+ // if (idx == element.length - 1) {
|
|
|
+ // procedure += el.id + "";
|
|
|
+ // } else {
|
|
|
+ // procedure += el.id + ",";
|
|
|
+ // }
|
|
|
+ // });
|
|
|
if (bool) {
|
|
|
let res = await this.axios({
|
|
|
method: "post",
|
|
|
url: "/api/order_area_explode_process",
|
|
|
data: {
|
|
|
- parts_id: element.part_id, /////
|
|
|
- price: element.process_price,
|
|
|
- properties:
|
|
|
- typeof element.properties == "string"
|
|
|
- ? [element.properties]
|
|
|
- : element.properties,
|
|
|
- // properties: element.properties,
|
|
|
+ parts_id: element.part_id,
|
|
|
+ price: element.process_price || 0,
|
|
|
+ properties,
|
|
|
title: element.processCombination,
|
|
|
- procedure,
|
|
|
+ procedure: element.partsProcessLineTableData,
|
|
|
op: "add",
|
|
|
},
|
|
|
});
|
|
|
@@ -2248,19 +2280,14 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
// 工艺路线保存 partsProcessLineTableData
|
|
|
- let procedure = "";
|
|
|
- let bool = false;
|
|
|
- element.partsProcessRouteList.forEach((ele) => {
|
|
|
- if (element.processCombination == ele.id && ele.id == ele.title) {
|
|
|
- bool = true;
|
|
|
- }
|
|
|
- });
|
|
|
- element.partsProcessLineTableData.forEach(async (el, idx) => {
|
|
|
- if (idx == element.length - 1) {
|
|
|
- procedure += el.id + "";
|
|
|
- } else {
|
|
|
- procedure += el.id + ",";
|
|
|
- }
|
|
|
+ let bool = true;
|
|
|
+ // element.partsProcessRouteList.forEach((ele) => {
|
|
|
+ // if (element.processCombination == ele.id && ele.id == ele.title) {
|
|
|
+ // bool = true;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ let properties = element.ProcessAttrList.map((v) => {
|
|
|
+ return { type_id: v.type_id, value: v.selected_value };
|
|
|
});
|
|
|
if (bool) {
|
|
|
let res = await this.axios({
|
|
|
@@ -2268,14 +2295,10 @@ export default {
|
|
|
url: "/api/order_area_explode_process",
|
|
|
data: {
|
|
|
parts_id: element.part_id, /////
|
|
|
- price: element.process_price,
|
|
|
- properties:
|
|
|
- typeof element.properties == "string"
|
|
|
- ? [element.properties]
|
|
|
- : element.properties,
|
|
|
- // properties: element.properties,
|
|
|
- title: element.processCombination,
|
|
|
- procedure,
|
|
|
+ price: element.process_price || 0,
|
|
|
+ properties,
|
|
|
+ title: element.processCombination || "",
|
|
|
+ procedure: element.partsProcessLineTableData,
|
|
|
op: "add",
|
|
|
},
|
|
|
});
|
|
|
@@ -2290,6 +2313,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.formData.parts.forEach((element) => {
|
|
|
+ element.processCombination = element.processCombination || "";
|
|
|
+ element.properties = element.processCombination || "";
|
|
|
element.detail = [
|
|
|
...element.partsWoodTableData,
|
|
|
...element.partsMetalseData,
|
|
|
@@ -2515,6 +2540,9 @@ export default {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
}
|
|
|
+ .parts_content_lineTable {
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -2572,8 +2600,8 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.box-us-foc {
|
|
|
- color: #fff;
|
|
|
- background:#3764ff;
|
|
|
+ color: #fff;
|
|
|
+ background: #3764ff;
|
|
|
border: 1px solid #3764ff;
|
|
|
}
|
|
|
}
|