mushencc 3 years ago
parent
commit
89e62c128e

+ 53 - 9
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -423,7 +423,20 @@
                 v-model="partsItem.partsWoodTableData[index].number"
               />
             </template>
-
+            <template slot-scope="{ index }" slot="sortSet">
+              <Input
+                placeholder="行号"
+                :disabled="type == 2"
+                v-model="partsItem.partsWoodTableData[index].sort"
+              />
+            </template>
+            <template slot-scope="{ index }" slot="rowSet">
+              <Input
+                placeholder="合并行号"
+                :disabled="type == 2"
+                v-model="partsItem.partsWoodTableData[index].row"
+              />
+            </template>
             <template slot-scope="{ index }" slot="partWoolLongSet">
               <Input
                 @on-search="openKey(partsIndex, index, 'wool_long', partsItem)"
@@ -540,6 +553,7 @@
                 <Option :value="2" label="大芯片"></Option>
                 <Option :value="3" label="否"></Option>
                 <Option :value="4" label="标签"></Option>
+                <Option :value="0" label="否"></Option>
               </Select>
             </template>
             <template slot-scope="{ index }" slot="partPrint_numSet">
@@ -1127,6 +1141,18 @@ export default {
         },
         { title: "单位", key: "company", align: "center", minWidth: 80 },
         {
+          title: "行号",
+          align: "center",
+          minWidth: 100,
+          slot: "sortSet",
+        },
+        {
+          title: "合并行号",
+          align: "center",
+          minWidth: 120,
+          slot: "rowSet",
+        },
+        {
           title: "毛料高",
           key: "wool_long",
           align: "center",
@@ -1337,6 +1363,7 @@ export default {
       order_no: this.$route.query.order_no,
       orders_area_product_detail_id: this.$route.query
         .orders_area_product_detail_id,
+      oa_id: this.$route.query.oa_id,
       selectTags: [], //已选列表
       info: {
         title: "",
@@ -1449,16 +1476,21 @@ export default {
     this.axios("/api/material", { params: { sub_type_id: 1 } }).then((res) => {
       this.materialWoodList = res.data.data;
     });
-    this.initData(this.order_no, this.orders_area_product_detail_id);
+    this.initData(
+      this.order_no,
+      this.orders_area_product_detail_id,
+      this.oa_id
+    );
   },
   methods: {
-    initData(order_no, orders_area_product_detail_id) {
+    initData(order_no, orders_area_product_detail_id, oa_id) {
       this.axios({
         method: "get",
         url: "/api/order_area_explode_detail",
         params: {
           order_no,
           orders_area_product_detail_id,
+          oa_id,
         },
       }).then((res) => {
         this.formData = res.data;
@@ -1512,7 +1544,11 @@ export default {
             },
           ];
         } else {
-          this.handleSimilarProductConfirm(res.data.product_id, this.formData);
+          this.handleSimilarProductConfirm(
+            res.data.product_id,
+            this.formData,
+            res
+          );
         }
       });
     },
@@ -1649,7 +1685,7 @@ export default {
     handleSimilarProductSelected(row, oldrow) {
       this.tempSimilarProductData = row;
     },
-    handleSimilarProductConfirm(id, isEditItem) {
+    handleSimilarProductConfirm(id, isEditItem, result) {
       if (id) {
         this.axios({
           method: "get",
@@ -1659,7 +1695,7 @@ export default {
           },
         }).then((res) => {
           if (res.code == 200) {
-            res.data.part.forEach((element) => {
+            res.data.part.forEach((element, index) => {
               element.part_title = element.title;
               this.formData.parts.forEach((ele, idx) => {
                 if (element.part_id == ele.part_id) {
@@ -1692,7 +1728,7 @@ export default {
             //     Object.assign(element, this.formData.parts[index]);
             //   });
             // }
-            this.formData.parts.map((element) => {
+            this.formData.parts.map((element, index) => {
               element.partsProcessLineTableData = [];
               element.proportion = element.ratio;
               element.isShowProcessLine = true;
@@ -1705,7 +1741,7 @@ export default {
                 element.wide = element.formula_w;
                 element.long = element.formula_l;
               }
-              this.handlePartsNameSelect_test(element, obj);
+              this.handlePartsNameSelect_test(element, obj, index, result);
             });
             if (isEditItem) {
               let item = isEditItem;
@@ -1788,7 +1824,7 @@ export default {
         }
       }
     },
-    handlePartsNameSelect_test(item, val) {
+    handlePartsNameSelect_test(item, val, index, result) {
       if (val && val.value) {
         if (val.label != val.value) {
           this.axios({
@@ -1818,6 +1854,14 @@ export default {
                 v.wide = temp_arr[temp_arr.length - 1].wide;
                 v.wool_wide = temp_arr[temp_arr.length - 1].wool_wide;
               }
+              if (result) {
+                v.long = result.data.parts[index].detail[k].long;
+                v.wide = result.data.parts[index].detail[k].wide;
+                v.wool_long = result.data.parts[index].detail[k].wool_long;
+                v.wool_wide = result.data.parts[index].detail[k].wool_wide;
+                v.row = result.data.parts[index].detail[k].row;
+                v.sort = result.data.parts[index].detail[k].sort;
+              }
             });
             item.partsMetalseData = res.data.detail.filter(
               (v) => v.type_id == 5

+ 302 - 79
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -44,6 +44,7 @@
               filterable
               clearable
               v-model="saveData.custom_title"
+              @on-change="handleCustomSelect"
               v-if="type == 6"
             >
               <Option
@@ -75,12 +76,56 @@
             <span v-else>{{ formData.front_money }}</span>
           </FormItem>
           <FormItem label="详细地址:">
+<<<<<<< HEAD
             <Input v-if="type == 6" v-model="saveData.address" placeholder="请输入详细地址"/>
             <span v-else>{{ formData.address }}</span>
           </FormItem>
           <FormItem label="手机号:">
             <Input v-if="type == 6" v-model="saveData.mobile" placeholder="请输入手机号"/>
             <span v-else>{{ formData.mobile }}</span>
+=======
+            <Select
+              clearable
+              filterable
+              v-if="type == 6"
+              class="auto-width"
+              @on-change="handleClientDetailChange"
+              v-model="saveData.custom_detail_id"
+            >
+              <Option
+                v-for="item in clientDetailList_address"
+                :label="item.address"
+                :key="item.id"
+                :value="item.id"
+              ></Option>
+            </Select>
+            <span v-else>{{ formData.address }}</span>
+          </FormItem>
+          <FormItem label="手机号:">
+            <Select
+              clearable
+              filterable
+              v-if="type == 6"
+              v-model="saveData.custom_detail_mobile"
+            >
+              <Option
+                v-for="item in clientDetailList_mobile"
+                :label="item.mobile"
+                :key="item.id"
+                :value="item.mobile"
+              ></Option>
+            </Select>
+            <!-- <span v-else>{{ formData.mobile }}</span> -->
+            <span v-else>{{
+              clientDetailList_mobile.filter(
+                (v) => v.mobile == saveData.custom_detail_mobile
+              ).length > 0
+                ? clientDetailList_mobile.filter(
+                    (v) => v.mobile == saveData.custom_detail_mobile
+                  )[0].mobile
+                : formData.mobile
+            }}</span>
+>>>>>>> bb26b73bdc2f7f4f4275f4231f9227b5edd5076f
           </FormItem>
           <FormItem label="开始日期:">
             <DatePicker
@@ -408,7 +453,11 @@
             style="margin: 0 auto"
           >
             <div v-show="tab === 1">
-              <Table :columns="totalColumns" :data="totalData" border> </Table>
+              <Table :columns="totalColumns" :data="totalData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleGoPage(row)">详情</a>
+                </template>
+              </Table>
               <Page
                 :page-size-opts="[10, 20, 30, 40, 100, 1000]"
                 @on-page-size-change="changeTotalSize"
@@ -423,6 +472,9 @@
             </div>
             <div v-show="tab === 2">
               <Table :columns="detailColumns" :data="detailData" border>
+                <template slot="setSlot" slot-scope="{ row }">
+                  <a @click="handleGoPage(row)">详情</a>
+                </template>
               </Table>
               <Page
                 :page-size-opts="[10, 20, 30, 40, 100, 1000]"
@@ -437,33 +489,31 @@
               />
             </div>
           </TabPane>
-          <div  slot="extra" class="upload">
-          <Button
-            @click="handleTabsAdd"
-            size="small"
-            style="margin-right: 10px"
-            type="primary"
-            ghost
-            v-if="type == 6"
-            >新增</Button
-          >
-           <Upload
-           :headers="headers"
-          :show-upload-list="false"
-          :on-error="uploadError"
-          :on-success="uploadSuccess"
-          :action="$store.state.ip + '/api/explode_save_import_new'" 
-          v-if="type == 6"
-          style="margin-right: 10px"
-        >
-          <Button
-            size="small"
-            type="primary"
-            ghost
-            >导入</Button
-          >
-           </Upload>
-           </div>
+          <div slot="extra" class="upload">
+            <Button
+              @click="handleTabsAdd"
+              size="small"
+              style="margin-right: 10px"
+              type="primary"
+              ghost
+              v-if="type == 6"
+              >新增</Button
+            >
+            <Upload
+              :headers="headers"
+              name="your_file"
+              :data="uploadData"
+              :show-upload-list="false"
+              :on-error="uploadError"
+              :on-success="uploadSuccess"
+              :before-upload="handleBeforeUpload"
+              :action="$store.state.ip + '/api/explode_save_import_new'"
+              style="margin-right: 10px"
+            >
+              <Button size="small" type="primary" ghost>导入</Button>
+            </Upload>
+          </div>
+>>>>>>> bb26b73bdc2f7f4f4275f4231f9227b5edd5076f
         </Tabs>
       </Card>
     </div>
@@ -502,10 +552,36 @@ export default {
         { title: "颜色", align: "center", key: "color", minWidth: 200 },
         { title: "工艺", align: "center", key: "work", minWidth: 200 },
         { title: "图纸", align: "center", key: "url", minWidth: 200 },
-        { title: "左右式", align: "center", key: "fashion", minWidth: 200 },
+        {
+          title: "左右式",
+          align: "center",
+          key: "fashion",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h(
+              "span",
+              {},
+              row.left_right_mode == 1
+                ? "左式"
+                : row.left_right_mode == 2
+                ? "右式"
+                : "无"
+            );
+          },
+        },
         { title: "备注", align: "center", key: "remark", minWidth: 200 },
-        { title: "拆单状态", align: "center", key: "state", minWidth: 200 },
-        { title: "操作", align: "center", minWidth: 200 },
+        {
+          title: "拆单状态",
+          align: "center",
+          key: "state",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+          },
+        },
+        { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
       ],
       totalData: [],
       headers: { Authorization: localStorage.getItem("token") },
@@ -537,9 +613,15 @@ export default {
           key: "product_title",
           minWidth: 200,
         },
+        {
+          title: "计量单位",
+          align: "center",
+          key: "product_unit",
+          minWidth: 200,
+        },
         { title: "图号", align: "center", key: "url_number", minWidth: 200 },
         { title: "型号", align: "center", key: "model", minWidth: 200 },
-        { title: "数量", align: "center", key: "num", minWidth: 200 },
+        // { title: "数量", align: "center", key: "num", minWidth: 200 },
         { title: "长", align: "center", key: "long", minWidth: 200 },
         { title: "宽", align: "center", key: "wide", minWidth: 200 },
         { title: "高", align: "center", key: "high", minWidth: 200 },
@@ -547,10 +629,36 @@ export default {
         { title: "颜色", align: "center", key: "color", minWidth: 200 },
         { title: "工艺", align: "center", key: "work", minWidth: 200 },
         { title: "图纸", align: "center", key: "url", minWidth: 200 },
-        { title: "左右式", align: "center", key: "fashion", minWidth: 200 },
+        {
+          title: "左右式",
+          align: "center",
+          key: "fashion",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h(
+              "span",
+              {},
+              row.left_right_mode == 1
+                ? "左式"
+                : row.left_right_mode == 2
+                ? "右式"
+                : "无"
+            );
+          },
+        },
         { title: "备注", align: "center", key: "remark", minWidth: 200 },
-        { title: "拆单状态", align: "center", key: "state", minWidth: 200 },
-        { title: "操作", align: "center", minWidth: 200 },
+        {
+          title: "拆单状态",
+          align: "center",
+          key: "state",
+          minWidth: 200,
+          render: (h, params) => {
+            const { row } = params;
+            return h("span", {}, row.state == 0 ? "未拆单" : "已拆单");
+          },
+        },
+        { title: "操作", align: "center", minWidth: 200, slot: "setSlot" },
       ],
       detailData: [],
       saveData: {
@@ -566,6 +674,8 @@ export default {
         residential_name: "",
         start_time: "",
         warning_state: "",
+        custom_detail_mobile: "",
+        custom_detail_id: "",
       },
       formData:{},
       custom_title_list:[],
@@ -613,7 +723,13 @@ export default {
       total: 0,
       page_index: 1,
       page_size: 10,
-      save_state:false,
+      save_state: false,
+      uploadData: {},
+      currency_tag: 0,
+      clientDetailList: [],
+      clientDetailList_respon: [],
+      clientDetailList_mobile: [],
+      clientDetailList_address: [],
     };
   },
   created() {
@@ -626,20 +742,93 @@ export default {
           this.formData = res.msg;
         });
       this.getData();
-    }else{
-        this.axios.get('/api/custom_list').then(res=>{ this.custom_title_list = res.data.data});
-        this.axios.get('/api/warning_list').then(res=>{ this.warning_state_list = res.data.data });
-        this.axios.get('/api/employee_list').then(res=>{ this.nickname_list = res.data });
+    } else {
+      this.axios.get("/api/custom_list").then((res) => {
+        this.custom_title_list = res.data.data;
+      });
+      this.axios.get("/api/warning_list").then((res) => {
+        this.warning_state_list = res.data.data;
+      });
+      this.axios
+        .get("/api/employee_list", { params: { type: 2 } })
+        .then((res) => {
+          this.nickname_list = res.data;
+        });
     }
   },
   methods: {
+    handleClientDetailChange(val) {
+      val && (this.info.custom_detail_id = val);
+    },
+    handleCustomSelect(id) {
+      id &&
+        this.axios({
+          method: "get",
+          url: "/api/custom_detail",
+          params: { id },
+        }).then((res) => {
+          this.clientDetailList = res.data.list;
+          // 去重负责人
+          this.clientDetailList_respon = this.unique(res.data.list);
+          // 赋值默认负责人
+          this.saveData.custom_detail_name = this.clientDetailList_respon[0].service_name;
+          // 取出手机号码是该负责人的
+          this.clientDetailList_mobile = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认手机号码
+          this.saveData.custom_detail_mobile = this.clientDetailList_mobile[0].mobile;
+          // 去重手机号码
+          this.clientDetailList_mobile = this.unique(
+            this.clientDetailList_mobile
+          );
+          // 取出地址是该负责人的
+          this.clientDetailList_address = this.clientDetailList.filter(
+            (item) => item.service_name == this.saveData.custom_detail_name
+          );
+          // 赋值默认地址
+          this.saveData.custom_detail_id =
+            this.clientDetailList_respon[0].id || 0;
+          this.saveData.service_id = res.data.detail.service_id;
+          // this.$forceUpdate();
+        });
+    },
+    unique(array) {
+      let arr = JSON.parse(JSON.stringify(array));
+      for (var i = 0; i < arr.length; i++) {
+        for (var j = i + 1; j < arr.length; j++) {
+          if (arr[i].service_name == arr[j].service_name) {
+            //第一个等同于第二个,splice方法删除第二个
+            arr.splice(j, 1);
+            j--;
+          }
+        }
+      }
+      return arr;
+    },
+    handleGoPage(row) {
+      this.$router.push({
+        path: "/cms/BidSystem/ProductDeOrder/deorderdetail",
+        query: {
+          type: 3,
+          order_no: this.$route.query.order_no || this.saveData.order_no,
+          oa_id: row.oa_id,
+          orders_area_product_detail_id: row.id,
+        },
+      });
+    },
+
+    handleTabsChange(name) {
+      this.currency_tag = name;
+      this.getData(name);
+    },
     changeTotalSize(e) {
       this.page_size = e;
-      this.getData();
+      this.getData(0);
     },
     changeTotalPage(e) {
       this.page_index = e;
-      this.getTotalData();
+      this.getData(0);
     },
     changeDetailSize(e) {
       this.page_size = e;
@@ -650,10 +839,9 @@ export default {
       this.getData(1);
     },
     getData(type) {
+      console.log('type :>> ', type);
       if (type === 1) {
         if (this.search_state) {
-          this.page_index = 1;
-          this.page_size = 10;
           this.axios
             .post("/api/order_area_details", {
               order_no: this.$route.query.order_no,
@@ -667,41 +855,74 @@ export default {
               this.total = res.msg.total;
             });
         } else {
-          this.page_index = 1;
-          this.page_size = 10;
-          this.axios
-            .post("/api/order_area_details", {
-              order_no: this.$route.query.order_no,
-              page_index: this.page_index,
-              page_size: this.page_size,
-            })
-            .then((res) => {
-              console.log(res);
-              this.detailData = res.msg.data;
-              this.total = res.msg.total;
-            });
+          this.$route.query.order_no &&
+            this.axios
+              .post("/api/order_area_details", {
+                order_no: this.$route.query.order_no || this.saveData.order_no,
+                page_index: this.page_index,
+                page_size: this.page_size,
+              })
+              .then((res) => {
+                console.log(res);
+                this.detailData = res.data.data;
+                this.total = res.data.total;
+                this.area_code = res.data.area_code;
+                this.area_title = res.data.area_title;
+                this.color = res.data.color;
+                this.fashion = res.data.fashion;
+                this.house = res.data.house;
+                this.house_type = res.data.house_type;
+                this.layer = res.data.layer;
+                this.material = res.data.material;
+                this.number = res.data.number;
+                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.unit = res.data.unit;
+                this.url_number = res.data.url_number;
+                this.work = res.data.work;
+                this.copy_form = this.searchData;
+              });
         }
       } else if (type === 0) {
-        //             this.page_index= 1;
-        //        this.page_size = 10;
-        //   this.axios
-        //     .post("/api/order_area_details",
-        //        {
-        //         ...this.$route.query,
-        //         ...{ page_index: this.page_index, page_size: this.page_size },
-        //         ...this.searchData
-        //       },
-        //     )
-        //     .then((res) => {
-        //         this.totalData = res.msg.data;
-        //            this.total = res.msg.total;
-        //     })
+        console.log('111 :>> ', 111);
+        this.axios
+          .post("/api/order_area_details", {
+            type:1,
+            order_no: this.$route.query.order_no || this.saveData.order_no,
+            page_index: this.page_index,
+            page_size: this.page_size,
+            ...this.searchData,
+          })
+          .then((res) => {
+            console.log(res);
+            this.detailData = res.data.data;
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            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.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
+            this.copy_form = this.searchData;
+          });
       } else {
-        this.page_index = 1;
-        this.page_size = 10;
         this.axios
           .post("/api/order_area_details", {
-            ...this.$route.query,
+            type: this.$route.query.type,
+            order_no: this.$route.query.order_no || this.saveData.order_no,
             ...{ page_index: this.page_index, page_size: this.page_size },
             ...this.searchData,
           })
@@ -729,15 +950,17 @@ export default {
           });
       }
     },
-     uploadError(err) {
-      this.$Message.error(err.msg || "上传失败");
+    uploadError(err) {
+      this.$Message.error(err.msg || "导入失败");
     },
     uploadSuccess(res) {
         
       if (res.code == 200) {
-        this.$Message.success(res.msg || "上传成功");
+        this.$Message.success("导入成功");
+        this.search_state = true;
+        this.getData(this.currency_tag);
       } else {
-        this.$Message.warning(res.msg || "上传失败");
+        this.$Message.warning(res.msg || "导入失败");
       }
       this.page_index = 1;
         this.page_size = 10;
@@ -790,7 +1013,7 @@ export default {
     },
     search() {
       this.search_state = true;
-      this.getData();
+      this.getData(this.currency_tag);
     },
   },
 };

+ 1 - 1
vue.config.js

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