|
@@ -283,6 +283,7 @@
|
|
|
class="radio-g"
|
|
|
:key="_item.type_title"
|
|
|
>
|
|
|
+ <!-- v-show="_item.display" -->
|
|
|
<span
|
|
|
:class="['box-us', _item.show ? 'box-us-foc' : '']"
|
|
|
@click="setBoxChange(item, _item)"
|
|
@@ -291,7 +292,8 @@
|
|
|
<div
|
|
|
:class="['radio-us', __item.show ? 'radio-us-foc' : '']"
|
|
|
v-for="__item in _item.list"
|
|
|
- @click="setRadioChange(_item, __item)"
|
|
|
+ @click="setRadioChange(_item, __item, index, partsItem, item.cld)"
|
|
|
+ v-show="__item.display"
|
|
|
:key="__item.id"
|
|
|
>
|
|
|
{{ __item.title }}
|
|
@@ -881,8 +883,8 @@ export default {
|
|
|
processRouteId: "",
|
|
|
processRouteName: "",
|
|
|
partsProcessLineColumns: [
|
|
|
- { title: "ID", key: "id", align: "center" },
|
|
|
- { title: "工序分类", key: "type", align: "center" },
|
|
|
+ { 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" },
|
|
@@ -1210,6 +1212,7 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ console.log("1 :>> ", 1);
|
|
|
this.formData = res.data;
|
|
|
this.formData.basic_product_id = 8;
|
|
|
// 获取产品分类、测量字段
|
|
@@ -1591,36 +1594,49 @@ export default {
|
|
|
},
|
|
|
// 选择工艺组合名称
|
|
|
handleProcessRouteSelect(item, val) {
|
|
|
- if (val.label != val.value) {
|
|
|
- item.isAddProcessRoute = false;
|
|
|
- this.axios({
|
|
|
- method: "get",
|
|
|
- url: "/api/process_route_detail",
|
|
|
- params: {
|
|
|
- id: val.value,
|
|
|
- },
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
+ if (val) {
|
|
|
+ item.ProcessAttrList.forEach((v) => {
|
|
|
+ v.cld.forEach((z) => {
|
|
|
+ z.list.forEach((element) => {
|
|
|
+ element.display = true;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (val.label != val.value) {
|
|
|
+ item.isAddProcessRoute = false;
|
|
|
+ this.axios({
|
|
|
+ method: "get",
|
|
|
+ url: "/api/process_route_detail",
|
|
|
+ params: {
|
|
|
+ id: val.value,
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
this.$nextTick(() => {
|
|
|
this.info = res.data;
|
|
|
item.process_price = res.data.price;
|
|
|
this.selectTags = res.data.produce_list;
|
|
|
const selectTagsId = this.selectTags.map((item) => item.id);
|
|
|
item.ProcessAttrList = res.data.list;
|
|
|
- item.properties = res.data.pp_id; ///存在问题
|
|
|
+ item.properties = res.data.pp_id.split(","); ///存在问题
|
|
|
item.ProcessAttrList.forEach((v) => {
|
|
|
v.cld.forEach((z) => {
|
|
|
// z.show = selectTagsId.includes(z.id)
|
|
|
+ ///////
|
|
|
z.display = !z.show;
|
|
|
// z.display = !selectTagsId.includes(z.id)
|
|
|
+ z.list.forEach((element) => {
|
|
|
+ element.display = JSON.parse(JSON.stringify(element.show));
|
|
|
+ element.show = false;
|
|
|
+ });
|
|
|
+ console.log("z :>> ", z);
|
|
|
});
|
|
|
});
|
|
|
item.partsProcessLineTableData = this.selectTags;
|
|
|
});
|
|
|
- })
|
|
|
- .catch((err) => {});
|
|
|
- } else {
|
|
|
- item.isAddProcessRoute = true;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ item.isAddProcessRoute = true;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//选择工艺路线
|
|
@@ -1664,41 +1680,47 @@ export default {
|
|
|
},
|
|
|
setBoxChange(parent, child) {
|
|
|
return;
|
|
|
- const { type } = this.$route.query;
|
|
|
- if (type == 3) {
|
|
|
- return;
|
|
|
+ // const { type } = this.$route.query;
|
|
|
+ // if (type == 3) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // child.show = !child.show;
|
|
|
+ // child.list.forEach((element) => {
|
|
|
+ // element.show = child.show;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ setRadioChange(parent, child, index, parts, cld) {
|
|
|
+ console.log("parent :>> ", parent);
|
|
|
+ console.log("parts :>> ", parts);
|
|
|
+ console.log("cld :>> ", cld);
|
|
|
+ if (this.type == 1) {
|
|
|
+ cld.forEach((element) => {
|
|
|
+ element.list.forEach((elem) => {
|
|
|
+ elem.id != child.id && (elem.show = false);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ child.show = !child.show;
|
|
|
+ parts.properties[index] = child.id;
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
- child.show = !child.show;
|
|
|
- child.list.forEach((element) => {
|
|
|
- element.show = child.show;
|
|
|
- });
|
|
|
},
|
|
|
- // setRadioChange(parent, child, index, parts) {
|
|
|
- // if (this.type == 1) {
|
|
|
- // parent.cld.forEach((element) => {
|
|
|
- // element.id != child.id && (element.show = false);
|
|
|
- // });
|
|
|
- // child.show = !child.show;
|
|
|
- // parts.properties[index] = child.id;
|
|
|
- // this.$forceUpdate();
|
|
|
+ // setRadioChange(parent, child) {
|
|
|
+ // const { type } = this.$route.query;
|
|
|
+ // if (type == 3) {
|
|
|
+ // return;
|
|
|
// }
|
|
|
+ // // let flag = true;
|
|
|
+ // parent.list.forEach((element) => {
|
|
|
+ // element.show = false
|
|
|
+ // if (!element.show) {
|
|
|
+ // // flag = false;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // child.show = !child.show;
|
|
|
+ // console.log('child.show :>> ', child.show);
|
|
|
+ // // parent.show = flag;
|
|
|
+ // this.$forceUpdate();
|
|
|
// },
|
|
|
- setRadioChange(parent, child) {
|
|
|
- const { type } = this.$route.query;
|
|
|
- if (type == 3) {
|
|
|
- return;
|
|
|
- }
|
|
|
- // let flag = true;
|
|
|
- parent.list.forEach((element) => {
|
|
|
- element.show = false
|
|
|
- if (!element.show) {
|
|
|
- // flag = false;
|
|
|
- }
|
|
|
- });
|
|
|
- child.show = !child.show;
|
|
|
- // parent.show = flag;
|
|
|
- this.$forceUpdate();
|
|
|
- },
|
|
|
handleProcessLineSet(row, index) {
|
|
|
this.info.id = row.id;
|
|
|
// this.info.title = row.title;
|
|
@@ -1859,9 +1881,10 @@ export default {
|
|
|
sum += element.proportion * 1;
|
|
|
});
|
|
|
if (sum != 100) {
|
|
|
- this.$Message.error("产值比之和须为1");
|
|
|
+ this.$Message.error("产值比之和须为100");
|
|
|
} else {
|
|
|
// 部件保存
|
|
|
+ let save_sucess = true;
|
|
|
for (let i in this.formData.parts) {
|
|
|
let element = this.formData.parts[i];
|
|
|
let flag = false;
|
|
@@ -1882,6 +1905,7 @@ export default {
|
|
|
label: element.pay_state,
|
|
|
title: element.part_id,
|
|
|
},
|
|
|
+ op: "add",
|
|
|
detail: [
|
|
|
...element.partsWoodTableData,
|
|
|
...element.partsMetalseData,
|
|
@@ -1928,6 +1952,8 @@ export default {
|
|
|
element.route_id = res.data.id;
|
|
|
element.part_id = result.data.id;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ save_sucess = false;
|
|
|
}
|
|
|
} else {
|
|
|
// 工艺路线保存 partsProcessLineTableData
|
|
@@ -1962,7 +1988,11 @@ export default {
|
|
|
op: "add",
|
|
|
},
|
|
|
});
|
|
|
- element.route_id = res.data.id;
|
|
|
+ if (res.code == 200) {
|
|
|
+ element.route_id = res.data.id;
|
|
|
+ } else {
|
|
|
+ save_sucess = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1973,21 +2003,23 @@ export default {
|
|
|
];
|
|
|
});
|
|
|
// 产品编辑保存
|
|
|
- await this.axios({
|
|
|
- method: "post",
|
|
|
- url: "/api/order_area_explode_save",
|
|
|
- data: {
|
|
|
- ...this.formData,
|
|
|
- order_no: this.$route.query.order_no,
|
|
|
- orders_area_product_detail_id:
|
|
|
- this.$route.query.orders_area_product_detail_id,
|
|
|
- },
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$Message.success(res.msg);
|
|
|
- this.goback();
|
|
|
- }
|
|
|
- });
|
|
|
+ if (save_sucess) {
|
|
|
+ await this.axios({
|
|
|
+ method: "post",
|
|
|
+ url: "/api/order_area_explode_save",
|
|
|
+ data: {
|
|
|
+ ...this.formData,
|
|
|
+ order_no: this.$route.query.order_no,
|
|
|
+ orders_area_product_detail_id:
|
|
|
+ this.$route.query.orders_area_product_detail_id,
|
|
|
+ },
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.goback();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
goback() {
|