mushencc 4 роки тому
батько
коміт
b25fcc8266

+ 16 - 16
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="changeDetail">
-    <Toptitle :title="type == 3 ? '生产拆单详情' : '生产拆单新增'">
+    <Toptitle :title="type == 3 ? '生产拆单详情' : type == 10?'深化单新增':'生产拆单新增'">
       <slot name="titleButton">
-        <Button type="primary" style="margin-right: 10px" v-if="type == 6"
+        <Button type="primary" style="margin-right: 10px" v-if="type == 6||type ==10"
           >开启拆单</Button
         >
         <Button type="primary" style="margin-right: 10px" v-if="type == 3"
@@ -18,7 +18,7 @@
         <Button
           type="primary"
           style="margin-right: 10px"
-          v-if="type == 6"
+          v-if="type == 6||type == 10"
           @click="save"
           >保存</Button
         >
@@ -29,7 +29,7 @@
         <Form class="form_content" :label-width="100">
           <FormItem label="项目编号:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.order_no"
               placeholder="请输入项目编码"
             />
@@ -37,7 +37,7 @@
           </FormItem>
           <FormItem label="项目名称:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.residential_name"
               placeholder="请输入项目名称"
             />
@@ -45,7 +45,7 @@
           </FormItem>
           <FormItem label="项目简称:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.abbreviation"
               placeholder="请输入项目简称"
             />
@@ -57,7 +57,7 @@
               clearable
               v-model="saveData.custom_title"
               @on-change="handleCustomSelect"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             >
               <Option
                 v-for="(item, index) in custom_title_list"
@@ -69,7 +69,7 @@
             <span v-else>{{ formData.custom_title }}</span>
           </FormItem>
           <FormItem label="紧急程度:">
-            <Select clearable v-model="saveData.warning_state" v-if="type == 6">
+            <Select clearable v-model="saveData.warning_state" v-if="type == 6||type == 10">
               <Option
                 v-for="(item, index) in warning_state_list"
                 :key="index"
@@ -81,7 +81,7 @@
           </FormItem>
           <FormItem label="项目定金:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.front_money"
               placeholder="请输入项目定金"
             />
@@ -91,7 +91,7 @@
             <Select
               clearable
               filterable
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               class="auto-width"
               @on-change="handleClientDetailChange"
               v-model="saveData.custom_detail_id"
@@ -109,7 +109,7 @@
             <Select
               clearable
               filterable
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.custom_detail_mobile"
             >
               <Option
@@ -136,7 +136,7 @@
               v-model="saveData.start_time"
               placeholder="年/月/日"
               style="width: 150px"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             ></DatePicker>
             <span v-else>{{ formData.start_time }}</span>
           </FormItem>
@@ -146,7 +146,7 @@
               v-model="saveData.end_time"
               placeholder="年/月/日"
               style="width: 150px"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             ></DatePicker>
             <span v-else>{{ formData.end_time }}</span>
           </FormItem>
@@ -155,7 +155,7 @@
               filterable
               clearable
               v-model="saveData.nickname"
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
             >
               <Option
                 v-for="(item, index) in nickname_list"
@@ -168,7 +168,7 @@
           </FormItem>
           <FormItem label="备注:">
             <Input
-              v-if="type == 6"
+              v-if="type == 6||type == 10"
               v-model="saveData.remark"
               type="textarea"
               placeholder="请输入备注"
@@ -532,7 +532,7 @@
               style="margin-right: 10px"
               type="primary"
               ghost
-              v-if="type == 6"
+              v-if="false"
               >新增</Button
             >
             <Upload

+ 124 - 21
src/views/ProductMannage/index.vue

@@ -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) {

+ 1 - 1
vue.config.js

@@ -1,6 +1,6 @@
 const axios_default_ip =
   process.env.NODE_ENV == "dev"
-    ? "http://124.71.176.88:882"
+    ? "http://121.41.102.225:82"
     : process.env.NODE_ENV == "test-prd"
     ? "http://121.41.102.225:82" //测试服
     : process.env.NODE_ENV == "prd_other"