|
|
@@ -155,7 +155,7 @@
|
|
|
:key="part.id"
|
|
|
id="content_left_item"
|
|
|
>
|
|
|
- <svg t="1638267575516" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3395" width="200" height="200" style="position: relative;left: 6px;top: -10px;" @click="edit(part)"><path d="M1005.037624 158.992107 899.701554 264.044722 759.214916 123.967406 864.587825 18.915815c19.389606-19.335371 50.835805-19.335371 70.225411 0l70.224388 70.047356C1024.42723 108.297518 1024.42723 139.656737 1005.037624 158.992107zM267.31879 614.19145l140.484591 140.091642-187.231265 46.62183L267.31879 614.19145zM864.587825 299.04998l-421.387259 420.210457L302.75179 579.203588l421.352467-420.211481L864.587825 299.04998zM113.70518 181.723831l0 728.575594 728.57764 0L842.28282 363.868241l109.289102-72.858378 0 692.146916c0 27.535123-8.895601 36.429701-36.432771 36.429701L54.296115 1019.58648c-27.535123 0-49.875944-22.305005-49.875944-49.841152L4.420171 108.866477c0-27.535123 8.858762-36.429701 36.428677-36.429701l692.14794 0L623.709733 181.723831 113.70518 181.723831z" p-id="3396" fill="#707070"></path></svg>
|
|
|
+ <svg t="1638267575516" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3395" width="200" height="200" style="position: relative;left: 6px;top: -10px;" @click="edit(part,3)"><path d="M1005.037624 158.992107 899.701554 264.044722 759.214916 123.967406 864.587825 18.915815c19.389606-19.335371 50.835805-19.335371 70.225411 0l70.224388 70.047356C1024.42723 108.297518 1024.42723 139.656737 1005.037624 158.992107zM267.31879 614.19145l140.484591 140.091642-187.231265 46.62183L267.31879 614.19145zM864.587825 299.04998l-421.387259 420.210457L302.75179 579.203588l421.352467-420.211481L864.587825 299.04998zM113.70518 181.723831l0 728.575594 728.57764 0L842.28282 363.868241l109.289102-72.858378 0 692.146916c0 27.535123-8.895601 36.429701-36.432771 36.429701L54.296115 1019.58648c-27.535123 0-49.875944-22.305005-49.875944-49.841152L4.420171 108.866477c0-27.535123 8.858762-36.429701 36.428677-36.429701l692.14794 0L623.709733 181.723831 113.70518 181.723831z" p-id="3396" fill="#707070"></path></svg>
|
|
|
<!-- <Icon type="md-create" style="position: relative;left: 10px;top: -8px;" color='black' :size='10'/> -->
|
|
|
<Button
|
|
|
type="primary"
|
|
|
@@ -164,7 +164,7 @@
|
|
|
@click="handlePartClick(part, 3)"
|
|
|
>{{ part.title }}</Button
|
|
|
>
|
|
|
- <svg t="1638267935515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5634" width="200" height="200" style="position: relative;left: -8px;top: -10px;" @click="del"><path d="M585.412525 512.594747L973.601616 124.418586c19.600808-19.600808 19.600808-51.898182 0-71.49899l-2.120404-2.120404c-19.600808-19.600808-51.898182-19.600808-71.49899 0L511.793131 439.518384 123.61697 50.799192c-19.600808-19.600808-51.898182-19.600808-71.49899 0l-2.120404 2.120404c-20.11798 19.600808-20.11798 51.898182 0 71.49899l388.189091 388.189091L49.997576 900.783838c-19.587879 19.600808-19.587879 51.898182 0 71.49899l2.120404 2.120404c19.600808 19.600808 51.898182 19.600808 71.49899 0L511.793131 586.214141l388.189091 388.176162c19.600808 19.600808 51.898182 19.600808 71.49899 0l2.120404-2.120404c19.600808-19.600808 19.600808-51.898182 0-71.49899L585.412525 512.594747z m0 0" p-id="5635" fill="#707070"></path></svg>
|
|
|
+ <svg t="1638267935515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5634" width="200" height="200" style="position: relative;left: -8px;top: -10px;" @click="del(part)"><path d="M585.412525 512.594747L973.601616 124.418586c19.600808-19.600808 19.600808-51.898182 0-71.49899l-2.120404-2.120404c-19.600808-19.600808-51.898182-19.600808-71.49899 0L511.793131 439.518384 123.61697 50.799192c-19.600808-19.600808-51.898182-19.600808-71.49899 0l-2.120404 2.120404c-20.11798 19.600808-20.11798 51.898182 0 71.49899l388.189091 388.189091L49.997576 900.783838c-19.587879 19.600808-19.587879 51.898182 0 71.49899l2.120404 2.120404c19.600808 19.600808 51.898182 19.600808 71.49899 0L511.793131 586.214141l388.189091 388.176162c19.600808 19.600808 51.898182 19.600808 71.49899 0l2.120404-2.120404c19.600808-19.600808 19.600808-51.898182 0-71.49899L585.412525 512.594747z m0 0" p-id="5635" fill="#707070"></path></svg>
|
|
|
<!-- <Icon type="md-close" style="position: relative;left: -10px;top: -8px;" color='black' :size='20'/> -->
|
|
|
</div>
|
|
|
<Button type="primary" ghost style="border-radius:10px;margin-left:10px" @click="add"
|
|
|
@@ -241,31 +241,32 @@
|
|
|
title="批量修改部件"
|
|
|
width="400"
|
|
|
:draggable='true'
|
|
|
+ @on-ok='edit_part'
|
|
|
>
|
|
|
<Form :model='formData' >
|
|
|
<FormItem >
|
|
|
<span>默认部件:</span>
|
|
|
- <Select v-model="formData.edit_part" style="width:140px">
|
|
|
- <Option v-for="item in productPartList" :key="item.id" :value="item.id">
|
|
|
+ <Select v-model="formData.part_id" style="width:140px">
|
|
|
+ <Option v-for="item in partsList" :key="item.id" :value="item.id">
|
|
|
{{item.title}}
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem >
|
|
|
- <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_l"/>
|
|
|
- <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_w"/>
|
|
|
- <span>厚:</span><Input type="number" style='width:60px' v-model="defaultPart.formula_h"/>
|
|
|
+ <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="formData.formula_l"/>
|
|
|
+ <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="formData.formula_w"/>
|
|
|
+ <span>厚:</span><Input type="number" style='width:60px' v-model="formData.formula_h"/>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
- <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
|
|
|
+ <span>是否为空: <vxe-switch v-model="formData.is_null"></vxe-switch> </span>
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
|
|
|
- <Modal title="批量修改部件"
|
|
|
+ <Modal title="批量删除部件"
|
|
|
width="400"
|
|
|
v-model="del_showModel"
|
|
|
-
|
|
|
+ @on-ok='del_part'
|
|
|
>
|
|
|
<div style="text-align:center">是否确定删除该部件?</div>
|
|
|
|
|
|
@@ -276,23 +277,24 @@
|
|
|
title="批量增加部件"
|
|
|
width="400"
|
|
|
:draggable='true'
|
|
|
+ @on-ok='add_part'
|
|
|
>
|
|
|
- <Form :model='formData' >
|
|
|
+ <Form :model='addData' >
|
|
|
<FormItem >
|
|
|
<span>默认部件:</span>
|
|
|
- <Select v-model="formData.edit_part" style="width:140px">
|
|
|
- <Option v-for="item in productPartList" :key="item.id" :value="item.id">
|
|
|
+ <Select v-model="addData.part_id" style="width:140px">
|
|
|
+ <Option v-for="item in partsList" :key="item.id" :value="item.id">
|
|
|
{{item.title}}
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem >
|
|
|
- <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_l"/>
|
|
|
- <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="defaultPart.formula_w"/>
|
|
|
- <span>厚:</span><Input type="number" style='width:60px' v-model="defaultPart.formula_h"/>
|
|
|
+ <span>高:</span><Input type="number" style='width:60px;margin-right:20px' v-model="addData.formula_l"/>
|
|
|
+ <span>宽:</span><Input type="number" style='width:60px;margin-right:20px' v-model="addData.formula_w"/>
|
|
|
+ <span>厚:</span><Input type="number" style='width:60px' v-model="addData.formula_h"/>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
- <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
|
|
|
+ <span>是否为空: <vxe-switch v-model="addData.is_null"></vxe-switch> </span>
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
@@ -307,11 +309,23 @@ export default {
|
|
|
components: { KeyBoard },
|
|
|
data() {
|
|
|
return {
|
|
|
+ part_id:null,
|
|
|
add_showModel:false,
|
|
|
edit_showModel:false,
|
|
|
del_showModel:false,
|
|
|
formData:{
|
|
|
- edit_part:null,
|
|
|
+ part_id:null,
|
|
|
+ formula_l:null,
|
|
|
+ formula_w:null,
|
|
|
+ formula_h:null,
|
|
|
+ is_null:null,
|
|
|
+ },
|
|
|
+ addData:{
|
|
|
+ part_id:null,
|
|
|
+ formula_l:null,
|
|
|
+ formula_w:null,
|
|
|
+ formula_h:null,
|
|
|
+ is_null:null,
|
|
|
},
|
|
|
list: [
|
|
|
{
|
|
|
@@ -642,14 +656,98 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ add_part(){
|
|
|
+ const temp_product = this.tableData.filter((item) => item.isSelect);
|
|
|
+ const product_id = temp_product.map((item) => item.id);
|
|
|
+ this.addData.is_null = this.addData.is_null?0:1;
|
|
|
+ this.axios.post('/api/support_product_parts_add',{product_id:product_id,...this.addData}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.axios
|
|
|
+ .post("/api/support_product_get_part", {
|
|
|
+ type:2,
|
|
|
+ basic_product_id: [this.$route.query.id],
|
|
|
+ product_id,
|
|
|
+ part_id: [],
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.productPartList = res.data;
|
|
|
+ this.productPartList.map((item) => (item.isSelect = false));
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
replaceItem(){
|
|
|
this.showModal = true;
|
|
|
},
|
|
|
+ edit_part(){
|
|
|
+ const temp_product = this.tableData.filter((item) => item.isSelect);
|
|
|
+ const product_id = temp_product.map((item) => item.id);
|
|
|
+ const temp_part = this.productPartList.filter((item) => item.isSelect);
|
|
|
+ const part_id = temp_part.map((item) => item.id);
|
|
|
+ this.formData.is_null = this.formData.is_null?0:1;
|
|
|
+ let parts_id = Number(part_id.toString()) ;
|
|
|
+ this.axios.post('/api/support_product_parts_edit',{
|
|
|
+ product_id:product_id,
|
|
|
+ part_id:parts_id,
|
|
|
+ children:{...this.formData}
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.axios
|
|
|
+ .post("/api/support_product_get_part", {
|
|
|
+ type:3,
|
|
|
+ basic_product_id: [this.$route.query.id],
|
|
|
+ product_id:product_id,
|
|
|
+ part_id:part_id,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.changeableTableData = res.data.list;
|
|
|
+ this.defaultPart = res.data.head;
|
|
|
+
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
add(){
|
|
|
+ this.addData = {
|
|
|
+ part_id:null,
|
|
|
+ formula_l:null,
|
|
|
+ formula_w:null,
|
|
|
+ formula_h:null,
|
|
|
+ is_null:null,
|
|
|
+ }
|
|
|
this.add_showModel = true;
|
|
|
},
|
|
|
- del(){
|
|
|
+ del(part){
|
|
|
this.del_showModel = true;
|
|
|
+ this.part_id = part.id;
|
|
|
+ },
|
|
|
+ del_part(){
|
|
|
+ const temp_product = this.tableData.filter((item) => item.isSelect);
|
|
|
+ const product_id = temp_product.map((item) => item.id);
|
|
|
+ this.axios.post('/api/support_product_parts_del',{product_id:product_id,part_id:this.part_id}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.axios
|
|
|
+ .post("/api/support_product_get_part", {
|
|
|
+ type:2,
|
|
|
+ basic_product_id: [this.$route.query.id],
|
|
|
+ product_id:product_id,
|
|
|
+ part_id: [],
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.productPartList = res.data;
|
|
|
+ this.productPartList.map((item) => (item.isSelect = false));
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
init(row) {
|
|
|
this.pageIndex = 1;
|
|
|
@@ -750,7 +848,10 @@ export default {
|
|
|
console.log(res);
|
|
|
this.changeableTableData = res.data.list;
|
|
|
this.defaultPart = res.data.head;
|
|
|
+ this.formData = res.data.head;
|
|
|
+ this.formData.is_null = res.data.head.is_null == 0?true:false;
|
|
|
this.defaultPart.title = part.title;
|
|
|
+ this.formData.part_id = part.id;
|
|
|
});
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
@@ -772,6 +873,7 @@ export default {
|
|
|
const product_id = temp_product.map((item) => item.id);
|
|
|
const temp_part = this.productPartList.filter((item) => item.isSelect);
|
|
|
const part_id = temp_part.map((item) => item.id);
|
|
|
+ console.log(product_id)
|
|
|
this.axios
|
|
|
.post("/api/support_product_batch", {
|
|
|
type: 3,
|
|
|
@@ -819,12 +921,13 @@ export default {
|
|
|
// this.proxyObj.sortList = sortList;
|
|
|
this.getData(this.proxyObj);
|
|
|
},
|
|
|
- edit(val){
|
|
|
+ edit(val,type){
|
|
|
this.productPartList.forEach(v=>{
|
|
|
v.isSelect = false;
|
|
|
})
|
|
|
val.isSelect = !val.isSelect
|
|
|
-
|
|
|
+ this.handlePartClick(val,type);
|
|
|
+
|
|
|
this.edit_showModel = true;
|
|
|
},
|
|
|
goPage(n, row) {
|