瀏覽代碼

no message

Andy 3 年之前
父節點
當前提交
bb26b73bdc
共有 3 個文件被更改,包括 278 次插入60 次删除
  1. 53 9
      src/views/BidSystem/ProductDeOrder/deorderdetail.vue
  2. 224 50
      src/views/BidSystem/ProductDeOrder/infoDetail.vue
  3. 1 1
      vue.config.js

+ 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

+ 224 - 50
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -56,6 +56,7 @@
               filterable
               clearable
               v-model="saveData.custom_title"
+              @on-change="handleCustomSelect"
               v-if="type == 6"
             >
               <Option
@@ -87,20 +88,47 @@
             <span v-else>{{ formData.front_money }}</span>
           </FormItem>
           <FormItem label="详细地址:">
-            <Input
+            <Select
+              clearable
+              filterable
               v-if="type == 6"
-              v-model="saveData.address"
-              placeholder="请输入详细地址"
-            />
+              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="手机号:">
-            <Input
+            <Select
+              clearable
+              filterable
               v-if="type == 6"
-              v-model="saveData.mobile"
-              placeholder="请输入手机号"
-            />
-            <span v-else>{{ formData.mobile }}</span>
+              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>
           </FormItem>
           <FormItem label="开始日期:">
             <DatePicker
@@ -433,7 +461,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"
@@ -448,6 +480,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]"
@@ -481,7 +516,6 @@
               :on-success="uploadSuccess"
               :before-upload="handleBeforeUpload"
               :action="$store.state.ip + '/api/explode_save_import_new'"
-              v-if="type == 6"
               style="margin-right: 10px"
             >
               <Button size="small" type="primary" ghost>导入</Button>
@@ -530,10 +564,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") },
@@ -565,9 +625,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 },
@@ -575,10 +641,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: {
@@ -594,6 +686,8 @@ export default {
         residential_name: "",
         start_time: "",
         warning_state: "",
+        custom_detail_mobile: "",
+        custom_detail_id: "",
       },
       formData: {},
       custom_title_list: [],
@@ -642,7 +736,11 @@ export default {
       page_size: 10,
       save_state: false,
       uploadData: {},
-      currency_tag: 1,
+      currency_tag: 0,
+      clientDetailList: [],
+      clientDetailList_respon: [],
+      clientDetailList_mobile: [],
+      clientDetailList_address: [],
     };
   },
   created() {
@@ -662,23 +760,86 @@ export default {
       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;
-      });
+      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;
@@ -689,11 +850,9 @@ export default {
       this.getData(1);
     },
     getData(type) {
+      console.log('type :>> ', type);
       if (type === 1) {
         if (this.search_state) {
-          console.log("1 :>> ", 1);
-          this.page_index = 1;
-          this.page_size = 10;
           this.axios
             .post("/api/order_area_details", {
               order_no: this.$route.query.order_no || this.saveData.order_no,
@@ -724,8 +883,6 @@ export default {
               this.copy_form = this.searchData;
             });
         } else {
-          this.page_index = 1;
-          this.page_size = 10;
           this.$route.query.order_no &&
             this.axios
               .post("/api/order_area_details", {
@@ -757,26 +914,43 @@ export default {
               });
         }
       } 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.data.data;
-        //            this.total = res.data.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,
           })
@@ -805,15 +979,15 @@ export default {
       }
     },
     uploadError(err) {
-      this.$Message.error(err.msg || "上传失败");
+      this.$Message.error(err.msg || "导入失败");
     },
     uploadSuccess(res) {
       if (res.code == 200) {
-        this.$Message.success(res.data || "上传成功");
+        this.$Message.success("导入成功");
         this.search_state = true;
         this.getData(this.currency_tag);
       } else {
-        this.$Message.warning(res.data || "上传失败");
+        this.$Message.warning(res.msg || "导入失败");
       }
     },
     async handleBeforeUpload() {
@@ -848,7 +1022,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' //测试服
     :