Explorar o código

家装门头版

mushencc %!s(int64=3) %!d(string=hai) anos
pai
achega
b593ff03a8

+ 26 - 10
src/views/BidSystem/DeepeningOrder/deepDetail.vue

@@ -5,9 +5,9 @@
         <!-- <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"
+        <!-- <Button type="primary" style="margin-right: 10px" v-if="type == 3"
           >批量下生产</Button
-        >
+        > -->
         <Button
           @click="goback()"
           type="primary"
@@ -419,8 +419,8 @@
                 <Option
                   v-for="(item, index) in state"
                   :key="index"
-                  :label="item.state === 0 ? '未拆单' : '已拆单'"
-                  :value="item.state"
+               :value="item.value"
+               :label="item.label"
                 ></Option>
               </Select>
             </FormItem>
@@ -516,7 +516,8 @@
               v-if="false"
               >新增</Button
             >
-             <Upload
+             <!-- <Upload
+               multiple
               :headers="headers"
               name="your_file"
               :data="uploadData"
@@ -526,9 +527,18 @@
               :before-upload="handleBeforeUpload"
               :action="$store.state.ip + '/api/deep_img_import'"
               style="margin-right: 10px"
+              v-if="$route.query.type!=3"
             >
               <Button size="small" type="primary" >图纸导入</Button>
-            </Upload>
+            </Upload> -->
+             <UploadImg
+             :headers="headers"
+              v-if="$route.query.type!=3"
+          :data="uploadData"
+          :isChecked="$route.query.type==3?false:true"
+          style="margin-right:10px;"
+          :action="$store.state.ip + '/api/deep_img_import'"
+        ></UploadImg>
             <Upload
               :headers="headers"
               name="your_file"
@@ -539,6 +549,7 @@
               :before-upload="handleBeforeUpload"
               :action="$store.state.ip + '/api/deep_import_new'"
               style="margin-right: 10px"
+               v-if="$route.query.type!=3"
             >
               <Button size="small" type="primary" ghost>导入</Button>
             </Upload>
@@ -549,7 +560,11 @@
   </div>
 </template>
 <script>
+import UploadImg from "./uploadImg/index.vue";
 export default {
+     components: {
+    UploadImg,
+  },
   data() {
     return {
       ruleValidate: {
@@ -779,7 +794,7 @@ export default {
       material: [],
       color: [],
       work: [],
-      state: [],
+    state: [{label:'已拆单',value:1},{label:'未拆单',value:0}],
       search_state: false,
       copy_form: [],
       type: this.$route.query.type,
@@ -994,7 +1009,7 @@ export default {
                 this.position = res.data.position;
                 this.product_title = res.data.product_title;
                 this.product_type = res.data.product_type;
-                this.state = res.data.state;
+                // this.state = res.data.state;
                 this.unit = res.data.unit;
                 this.url_number = res.data.url_number;
                 this.work = res.data.work;
@@ -1029,7 +1044,7 @@ export default {
             this.position = res.data.position;
             this.product_title = res.data.product_title;
             this.product_type = res.data.product_type;
-            this.state = res.data.state;
+            // this.state = res.data.state;
             this.unit = res.data.unit;
             this.url_number = res.data.url_number;
             this.work = res.data.work;
@@ -1061,7 +1076,7 @@ export default {
             this.position = res.data.position;
             this.product_title = res.data.product_title;
             this.product_type = res.data.product_type;
-            this.state = res.data.state;
+            // this.state = res.data.state;
             this.unit = res.data.unit;
             this.url_number = res.data.url_number;
             this.work = res.data.work;
@@ -1172,6 +1187,7 @@ export default {
 .upload {
   display: flex;
   justify-content: space-around;
+ align-items: center;
 }
 .items {
   width: auto;

+ 2 - 2
src/views/BidSystem/DeepeningOrder/uploadImg/index.vue

@@ -12,8 +12,8 @@
 </template>
 <style lang="scss" scoped>
 .inputWrapButton {
-  height: 32px;
-  line-height: 32px;
+  height: 26px;
+  line-height: 26px;
   padding: 0 15px;
   user-select: none;
   border-radius: 4px;

+ 134 - 9
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -772,13 +772,13 @@
             </template>
           </vxe-column>
           <vxe-column title="门头板" min-width="100" :edit-render="{}">
-            <template #default="scope">
+            <!-- <template #default="scope"> -->
               <!-- {{
                 scope.row.part.filter(
                   (v) => v.part_title && v.part_title.indexOf("门头板")
                 )[0].part_title
               }} -->
-            </template>
+            <!-- </template> -->
             <template #edit="scope">
               <div>
                 <a v-if="!scope.row.addMTB" @click="handleMTBClick(scope.row)"
@@ -1113,10 +1113,14 @@
               </Tooltip>
             </template>
           </vxe-column>
-          <vxe-column title="附加金额" min-width="40">
+          <vxe-column title="附加金额" min-width="40" :edit-render="{}">
             <template #default="scope"
               >{{ scope.row.is_metal ? scope.row.price : scope.row.ext_price }}
             </template>
+            <template #edit="scope">
+              <Input v-if="!scope.row.is_metal" v-model="scope.row.ext_price" @on-change='(e) =>changeExtPrice(e, scope.row)'/>
+              <span v-else></span>
+            </template>
           </vxe-column>
           <vxe-column field="over_price" title="超标金额" min-width="40">
           </vxe-column>
@@ -1777,6 +1781,8 @@
                       clearable
                       :disabled="isCheck"
                       v-model="element.long"
+                      @on-focus='longFocus(idx)'
+                      @on-change='changeHigh(element,idx,modalData)'
                       @on-blur="handleIsSpecialPart(modalData, element)"
                       style="width: 50px"
                       placeholder="请输入高"
@@ -1793,6 +1799,8 @@
                     <Input
                       size="small"
                       clearable
+                       @on-focus='wideFocus(idx)'
+                       @on-change='changeHigh(element,idx,modalData)'
                       :disabled="isCheck"
                       v-model="element.wide"
                       style="width: 50px"
@@ -1810,6 +1818,7 @@
                     <Input
                       size="small"
                       clearable
+                       @on-focus='highFocus(idx)'
                       :disabled="isCheck"
                       v-model="element.high"
                       style="width: 50px"
@@ -1898,6 +1907,8 @@
                       }}</Button
                     >
                   </FormItem>
+                  <!-- 门头板信息 -->
+
                   <div
                     :class="[
                       'part_detail_form',
@@ -1905,6 +1916,43 @@
                     ]"
                     :data-index="idx"
                   >
+                    <div v-show="element.addMTB" style="padding-left:46px">
+                      <FormItem label="数量">
+                        <Input
+                          size="small"
+                          @on-focus='numFocus(idx)'
+                          @on-change='changeNum(element, idx, modalData)'
+                          v-model="element.MTBnum"
+                          style="width: 80px"
+                        />
+                      </FormItem>
+                      <FormItem label="面积">
+                        <Input
+                            @on-change='changeNum(element, idx, modalData)'
+                          size="small"
+                          v-model="element.MTBsize"
+                          style="width: 80px"
+                        />
+                      </FormItem>
+                      <FormItem label="单价">
+                        <Input
+                        @on-focus='priceFocus(idx)'
+                        @on-change='changeNum(element, idx, modalData)'
+                          size="small"
+                          v-model="element.MTBprice"
+                          style="width: 80px"
+                        />
+                      </FormItem>
+                      <FormItem label="金额">
+                        <Input
+                        disabled
+                          class="price"
+                          size="small"
+                          v-model="element.MTBtotal"
+                          style="width: 80px;"
+                        />
+                      </FormItem>
+                    </div>
                     <FormItem>
                       <div
                         v-for="(ele, idx) in element.part_detail"
@@ -2197,6 +2245,8 @@ export default {
   },
   data() {
     return {
+      ext_sum:0,
+      MTBtotal:0,
       currency_edit_index: null,
       measure_total: [],
       part_type_total: [],
@@ -2600,6 +2650,53 @@ export default {
       });
   },
   methods: {
+    numFocus(idx){
+      this.modalData.part[idx].MTBnum = '';
+       this.$forceUpdate();
+    },
+    priceFocus(idx){
+      this.modalData.part[idx].MTBprice = '';
+      this.$forceUpdate();
+    },
+    longFocus(idx){
+      this.modalData.part[idx].long = '';
+    },
+     wideFocus(idx){
+      this.modalData.part[idx].wide = '';
+    },
+     highFocus(idx){
+      this.modalData.part[idx].high = '';
+    },
+    changeHigh(row,index,arr){
+     if(row.addMTB){
+        if(row.long&&row.wide){
+          row.MTBsize = 1*row.long*row.wide;
+         arr.part[index].MTBsize = 1*row.long*row.wide;
+        //  arr.part[index].MTBtotal = arr.part[index].MTBsize*arr.part[index].MTBnum*arr.part[index].MTBprice*1
+        this.changeNum(row,index,arr)
+        }
+     }else{
+       return
+     }
+    },
+    changeNum(row,index,arr){
+      if(row.MTBnum&&row.MTBsize&&row.MTBprice){
+
+        row.MTBtotal = row.MTBnum*1*row.MTBsize*row.MTBprice
+        arr.part[index].MTBtotal = row.MTBnum*1*row.MTBsize*row.MTBprice
+        this.MTBtotal = arr.part[index].MTBtotal
+        arr.ext_price = this.ext_sum + this.MTBtotal; 
+        arr.price =
+        (arr.unit_price * 1 || 0) * (arr.num * 1 || 1) +
+        (arr.over_price * 1 || 0) +
+        (arr.ext_price * 1 || 0);
+      arr.price = arr.price.toFixed(2);
+        this.$forceUpdate();
+      }else{
+       return 
+      }
+       console.log(row)
+    },
     quoteRoughDraft() {
       this.axios
         .post("/api/update/get_table", {
@@ -3122,6 +3219,7 @@ export default {
           this.handleCalcCount();
           this.showEditProduct = false;
           this.$forceUpdate();
+          console.log(this.tableData)
         },
         onCancel: () => {},
       });
@@ -3342,6 +3440,7 @@ export default {
       row.addMTB = true;
       const _obj = {
         is_metal: false,
+        addMTB: true,
         isBP: false,
         isChoosed: false,
         change_id: "",
@@ -3351,7 +3450,7 @@ export default {
         high: "",
         hide_measure: [],
         process: [],
-        part_id: 25, //门头板ID
+        part_id: '', //门头板ID   没有part_id 通过选择框来确定part_id 就是id
         hide_process: ["1", "2", "3"],
         part_detail: [
           {
@@ -3900,6 +3999,7 @@ export default {
           (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
         );
         this.tableData.push(obj);
+        console.log(this.tableData)
         this.$forceUpdate();
       } else {
         this.$Message.warning("请先选择客户");
@@ -3939,6 +4039,7 @@ export default {
           this.title_state = 2;
           this.isCheck = false;
           if (this.type == 1) {
+            console.log(row)
             this.showEditProduct = true;
             this.modalData = JSON.parse(JSON.stringify(row));
             this.currencyIndex = index;
@@ -4135,7 +4236,8 @@ export default {
       item.extArray.map((v) => {
         return (sum += v.total_price * 1);
       });
-      item.ext_price = sum;
+      this.ext_sum = sum
+      item.ext_price = this.ext_sum +this.MTBtotal;
       item.price =
         (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
         (item.over_price * 1 || 0) +
@@ -4151,7 +4253,8 @@ export default {
         item.extArray.forEach((element) => {
           sum2 += element.total_price * 1 || 0;
         });
-      item.ext_price = sum2 * 1;
+        this.ext_sum = sum2*1
+      item.ext_price = this.ext_sum +this.MTBtotal;
       item.price =
         (item.unit_price * 1 || 0) * (item.num * 1 || 1) +
         (item.over_price * 1 || 0) +
@@ -4515,6 +4618,7 @@ export default {
             element.measureCalc = element.e_title;
           });
           this.tableData.splice(rowIndex, 1, row);
+         
           this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
           row.get_first_data = false;
           this.handleCalcCount();
@@ -4834,12 +4938,16 @@ export default {
         })
         .then((res) => {
           this.modalData.part.map((part) => {
-            if (part.part_id === 25) {
+            if (part.addMTB) {
               res.data.sub_part.map((v) => {
                 v.material_detail_id =
                   v.material_detail_list[0].material_detail_id;
                 v.material_detail_num = 1;
               });
+              part.MTBsize = res.data.long*res.data.wide*1;
+              part.MTBnum = res.data.MTBnum?res.data.MTBnum:0;
+              part.MTBprice = res.data.MTBprice?res.data.MTBprice:0;
+              part.part_id = part.change_id;
               part.part_detail = res.data.sub_part;
               part.long = res.data.long;
               part.high = res.data.high;
@@ -4851,7 +4959,8 @@ export default {
         });
     },
     handlePartChange($event, row, measure, product_num) {
-      if (row.part_id === 25) {
+      console.log(row)
+      if (row.addMTB) {
         this.handeMTBSelection($event, row);
       } else {
         if ($event) {
@@ -5007,6 +5116,17 @@ export default {
       product.price = product.price.toFixed(2);
       this.$forceUpdate();
     },
+    changeExtPrice(e, product){
+      console.log(e)
+  product.ext_price = e.target.value * 1;
+      product.price =
+        (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
+        (product.over_price * 1 || 0) +
+        (product.ext_price * 1 || 0);
+      product.price = product.price.toFixed(2);
+      this.handleCalcCount();
+      
+    },
     handleProductUnit_priceChange(e, product) {
       product.unit_price = e.target.value * 1;
       product.price =
@@ -5018,6 +5138,7 @@ export default {
       // this.$forceUpdate();
     },
     handleProductExt_priceChange(e, product) {
+      console.log(product)
       product.ext_price = e.target.value * 1;
       product.price =
         (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
@@ -5062,7 +5183,7 @@ export default {
           change.push({
             old_id: item.org_part_id || item.part_id,
             new_id: item.change.filter((v) => v.id == item.change_id)[0]
-              .part_id,
+              .part_id||item.part_id,
           });
         });
         let list = product.process_obj.map((item) => {
@@ -5889,4 +6010,8 @@ export default {
 /deep/.vxe-table--render-default .vxe-cell {
   padding: 0;
 }
+
+/deep/.price .ivu-input[disabled]{
+  color: black;
+}
 </style>

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "http://124.71.176.88:882"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://121.37.173.82:82" //测试服
+    ? "http://124.71.176.88:882" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";