Browse Source

Merge branch 'cjh' of http://121.41.102.225:3000/gogs/jf_h5 into hw

mushencc 3 years ago
parent
commit
89aaa29125

+ 228 - 14
src/views/ProductionOrderList/Deliverylist/Deliverylist.vue

@@ -1,6 +1,10 @@
 <template>
   <div>
+    <Toptitle title="发货单">
+      <Button type="primary" ghost @click="postData"> 导出 </Button>
+    </Toptitle>
     <FullPage
+      v-if="false"
       title="发货单"
       :list="set_list"
       @init="init"
@@ -69,6 +73,150 @@
         <a @click="goPage(row, 3)" class="map-margin">匹配五金</a>
       </template>
     </FullPage>
+
+    <div class="page-edit" v-else>
+      <Form :label-width="120" class="form_content">
+        <FormItem label="订单编号">
+          <Input
+            clearable
+            v-model="searchFrom.order_no"
+            placeholder="请输入订单编号"
+          ></Input>
+        </FormItem>
+        <FormItem label="订单状态">
+          <Select
+            clearable
+            v-model="searchFrom.sub_state"
+            placeholder="请选择"
+            style="width: 200px"
+          >
+            <Option
+              v-for="item in stateList"
+              :value="item.value"
+              :key="item.value"
+              >{{ item.label }}</Option
+            >
+          </Select>
+        </FormItem>
+        <FormItem label="紧急程度">
+          <Select
+            clearable
+            v-model="searchFrom.warning_state"
+            placeholder="请选择"
+            style="width: 200px"
+          >
+            <Option
+              v-for="item in warningList"
+              :value="item.id"
+              :key="item.title"
+              >{{ item.title }}</Option
+            >
+          </Select>
+        </FormItem>
+        <FormItem label="项目名称">
+          <Input
+            clearable
+            v-model="searchFrom.residential_name"
+            placeholder="请输入项目名称"
+          ></Input>
+        </FormItem>
+        <FormItem label="图号">
+          <Select
+            clearable
+            v-model="searchFrom.url_number"
+            multiple
+            filterable
+            style="width: 180px"
+          >
+            <Option
+              v-for="item in url_number_list"
+              :value="item.title"
+              :key="item.title"
+              >{{ item.title }}</Option
+            >
+          </Select>
+        </FormItem>
+        <FormItem label="出库日期范围">
+          <DatePicker
+            clearable
+            transfer
+            type="daterange"
+            @on-change="fromTime"
+            placement="bottom-end"
+            placeholder="请选择时间"
+            style="width: 200px"
+          ></DatePicker>
+        </FormItem>
+        <FormItem :label-width="40">
+          <Button type="primary" @click="initData(searchFrom)">搜索</Button>
+        </FormItem>
+      </Form>
+      <div>
+        <Checkbox @on-change="showTrueChange"
+          >展示确认出库百分比不一致的数据</Checkbox
+        >
+      </div>
+      <Table
+        ref="table"
+        :loading="loading"
+        @on-selection-change="selectTable"
+        border
+        :columns="tableColums"
+        :data="tableData"
+      >
+        <template slot="basicTypeSet" slot-scope="{ row }">
+          <div>
+            <span
+              v-for="item in warningList"
+              :key="item.id"
+              :style="{ color: item.color }"
+              v-show="item.id == row.warning_state"
+              >{{ item.title }}</span
+            >
+          </div>
+        </template>
+        <template slot="set" slot-scope="{ row }">
+          <a class="map-margin" @click="goPage(row, 1)">详情</a>
+          <a class="map-margin" @click="goPage(row, 2)">查看异常</a>
+          <a
+            @click="confirmOutStock(row, 1)"
+            v-if="row.state == 0"
+            class="map-margin"
+            >发货完成</a
+          >
+          <!-- &&(persimissionData['确认出库'] || persimissionData.all) -->
+          <a
+            @click="confirmOutStock(row, 2)"
+            v-if="row.state == 1"
+            class="map-margin"
+            >收货完成</a
+          >
+          <!-- &&(persimissionData['确认运输'] || persimissionData.all) -->
+          <a
+            class="map-margin"
+            @click="
+              goBigScreen(row);
+              showModal = true;
+            "
+            >大屏</a
+          >
+          <a @click="goPage(row, 3)" class="map-margin">匹配五金</a>
+        </template>
+      </Table>
+      <div class="content_body_page">
+        <Page
+          :page-size-opts="[10, 20, 30, 40, 100]"
+          @on-page-size-change="changeSize"
+          @on-change="changePage"
+          :current="pageIndex"
+          show-total
+          show-elevator
+          :total="total"
+          show-sizer
+          :page-size="pageSize"
+        />
+      </div>
+    </div>
     <Modal v-model="showModal" fullscreen footer-hide class="modal-bs">
       <template slot="header">
         <div class="modal-title">
@@ -155,6 +303,17 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
+      searchData: [],
+      typeList: [
+        { label: "工装", value: 1 },
+        { label: "家装", value: 0 },
+      ],
+      stateList: [
+        { label: "可以派工", value: 0 },
+        { label: "已派工", value: 1 },
+        { label: "已完成", value: 2 },
+      ],
+      searchFrom: {},
       type: 0, //不展示确认出库百分比与运输百分比不一定的数据
       chooseData: [],
       url_number_list: [],
@@ -258,8 +417,8 @@ export default {
         },
       ],
       tableData: [],
-      pageIndex: 1,
-      pageSize: 10,
+      pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+      pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
       total: 0,
       proxyObj: {},
       loading: false,
@@ -296,6 +455,16 @@ export default {
       timer: "",
     };
   },
+  mounted() {
+    if (localStorage.getItem("searchFrom")) {
+      this.searchFrom = JSON.parse(localStorage.getItem("searchFrom"));
+    }
+    if (localStorage.getItem("newSearchFrom")) {
+      this.init(JSON.parse(localStorage.getItem("newSearchFrom")));
+    }else{
+      this.init()
+    }
+  },
   computed: {
     ...mapState(["persimissionData"]),
     computedTable() {
@@ -396,16 +565,36 @@ export default {
   beforeRouteLeave(to, from, next) {
     if (
       to.path == "/cms/productionorderlist/deliverylist/deliverylistDetail" ||
-      "/cms/productionorderlist/deliverylist/checkUnusual" ||
-      "/cms/productionorderlist/deliverylist/matchIronware"
+      to.path == "/cms/productionorderlist/deliverylist/checkUnusual" ||
+      to.path == "/cms/productionorderlist/deliverylist/matchIronware"
     ) {
+      from.meta.keepAlive = false;
+      localStorage.setItem("searchFrom", JSON.stringify(this.searchFrom));
+      localStorage.setItem("pageSize", this.pageSize);
+      localStorage.setItem("pageIndex", this.pageIndex);
       next();
     } else {
+      let form = this.searchFrom;
+      Object.keys(form).forEach((key) => (form[key] = ""));
+      localStorage.setItem("searchFrom", form);
+      localStorage.setItem("newSearchFrom", form);
+      localStorage.removeItem("searchFrom");
+      localStorage.removeItem("newSearchFrom");
+      localStorage.removeItem("pageSize");
+      localStorage.removeItem("pageIndex");
       from.meta.keepAlive = false;
       next();
     }
   },
   methods: {
+    initData(row) {
+      localStorage.setItem("newSearchFrom", JSON.stringify(row));
+      this.init(row);
+    },
+    fromTime(data1, data2) {
+      this.searchFrom.start_time = data1[0];
+      this.searchFrom.end_time = data1[1];
+    },
     showTrueChange(e) {
       if (e) {
         this.type = 1;
@@ -417,7 +606,6 @@ export default {
     },
     selectTable(e) {
       this.chooseData = e;
-      console.log(this.chooseData);
     },
     async postData() {
       if (this.chooseData.length == 0) {
@@ -437,16 +625,22 @@ export default {
     },
 
     init(row) {
-      this.pageIndex = 1;
-      row.page_index = this.pageIndex;
-      row.page_size = this.pageSize;
-      row.type = this.type;
-      this.proxyObj = JSON.parse(JSON.stringify(row));
-      this.getData(this.proxyObj);
+      if (row) {
+        row.page_index = this.pageIndex;
+        row.page_size = this.pageSize;
+        row.type = this.type;
+        this.proxyObj = JSON.parse(JSON.stringify(row));
+        this.getData(this.proxyObj);
+      } else {
+        this.proxyObj = {
+          page_index: this.pageIndex,
+          page_size: this.pageSize,
+        };
+        this.getData(this.proxyObj);
+      }
     },
     getData(row) {
       this.loading = true;
-      console.log(row, 1);
       this.axios("/api/orders_out_list", { params: row }).then((res) => {
         this.loading = false;
         if (res.code == 200) {
@@ -463,7 +657,6 @@ export default {
 
           this.set_list[4].option = data;
           this.url_number_list = data;
-          console.log(this.set_list[4].option);
         }
       });
     },
@@ -496,7 +689,6 @@ export default {
         content: type == 1 ? "确认发货么?" : "确认收货么?",
         type: "primary",
         then: (e) => {
-          console.log(123, e);
           this.axios.post(post_url, params).then((res) => {
             if (res.code == 200) {
               this.$Message.success(res.msg);
@@ -639,6 +831,28 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.content_body_page {
+  text-align: center;
+  margin-top: 10px;
+}
+.form_content {
+  margin-top: 15px;
+  display: flex;
+  flex-wrap: wrap;
+}
+.nav {
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-end;
+  margin-top: 10px;
+}
+.page-edit {
+  // overflow: hidden;
+  overflow-y: auto;
+  position: relative;
+  top: 0px;
+  height: 80%;
+}
 .modal-bs {
   /deep/.ivu-modal-header,
   /deep/.ivu-modal-body,

+ 24 - 4
src/views/leadMatch/Ironware/list.vue

@@ -12,7 +12,7 @@
           <FormItem label='项目简称:' style="width:250px">
                <Input placeholder="请输入项目简称" v-model="searchData.abbreviation" clearable/>
           </FormItem>
-          <FormItem><Button type="primary" @click="initData(searchData)">搜索</Button></FormItem>
+          <FormItem><Button type="primary" @click="searchDataClick(searchData)">搜索</Button></FormItem>
       </Form>
       <div class="up_table">
           <Button type="primary"  @click="handleSet(null,1)">新增</Button>
@@ -43,8 +43,8 @@ export default {
     data(){
         return {
             proxyData:{},
-            pageIndex:1,
-            pageSize:10,
+            pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+            pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
             total:0,
                searchData:{
                    project_name:'',
@@ -66,9 +66,21 @@ export default {
         }
     },
     mounted(){
-         this.initData();
+      if(localStorage.getItem('searchList')){
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData();
+      }
+      if (localStorage.getItem("list")) {
+      this.searchData = JSON.parse(localStorage.getItem("list"));
+      }  
     },
     methods:{
+      searchDataClick(row){
+        console.log(row);
+        this.initData(row);
+        localStorage.setItem('searchList',JSON.stringify(row))
+      },
         handleSet(row,type){
             //1 新增 2 编辑 3 查看 4 删除
             switch(type){
@@ -114,9 +126,17 @@ export default {
       if (
         to.path == "/cms/leadMatch/Ironware/edit"
       ) {
+        from.meta.keepAlive = false;
+        localStorage.setItem("list", JSON.stringify(this.searchData));
+        localStorage.setItem("pageSize", this.pageSize);
+        localStorage.setItem("pageIndex", this.pageIndex);
         next();
       } else {
         from.meta.keepAlive = false;
+        localStorage.removeItem("list");
+        localStorage.removeItem("pageSize");
+        localStorage.removeItem("pageIndex");
+        localStorage.removeItem("searchList");
         next();
       }
     }

+ 45 - 5
src/views/leadMatch/roomList/BSTlist.vue

@@ -5,7 +5,7 @@
     </Toptitle>
     <div class="weight_memo_content">
       <div>
-        <Topsearch :list="list" @init="initData" @searchData="initData" />
+        <Topsearch :list="list" @init="initData" @searchData="searchData" />
       </div>
       <div
         style="
@@ -120,12 +120,41 @@ export default {
                         }},
       ],
       tableData: [],
-      pageIndex: 1,
-      pageSize: 10,
+      pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+      pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
       total: 0,
     };
   },
+  mounted() {
+    if (localStorage.getItem("list")) {
+      this.list = JSON.parse(localStorage.getItem("list"));
+    }
+    if (localStorage.getItem("searchList")) {
+      this.$nextTick(() => {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      });
+    }
+  },
   methods: {
+    searchData(){
+      this.pageIndex = 1;
+      this.pageSize = 10;
+      let row = {};
+      this.list.forEach((e) => {
+        if (e.serverName == "project_number") {
+          this.$set(row, "project_number", e.value);
+        }
+        if (e.serverName == "project_name") {
+          this.$set(row, "project_name", e.value);
+        }
+        if (e.serverName == "abbreviation") {
+          this.$set(row, "abbreviation", e.value);
+        }
+        // this.$set(对象, key, 数组);
+      });
+      localStorage.setItem("searchList", JSON.stringify(row));
+      this.initData(row);
+    },
     initData(row) {
       console.log(row)
       this.axios.get('/api/cut_order_list',{params:{
@@ -153,6 +182,9 @@ export default {
          
     },
     gotoPage(type,row){
+      localStorage.setItem("list", JSON.stringify(this.list));
+      localStorage.setItem("pageSize", this.pageSize);
+      localStorage.setItem("pageIndex", this.pageIndex);
       //1 编辑 2 查看 3 新增
       switch(type){
         case 1:
@@ -164,11 +196,19 @@ export default {
     },
     changeSize (e) {
       this.pageSize = e;
-      this.initData()
+        if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
      changePage (e) {
       this.pageIndex = e;
-      this.initData()
+        if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
   },
 };

+ 45 - 6
src/views/leadMatch/roomList/HXYlist.vue

@@ -5,7 +5,7 @@
     </Toptitle>
     <div class="weight_memo_content">
       <div>
-        <Topsearch :list="list" @init="initData" @searchData="initData" />
+        <Topsearch :list="list" @init="initData" @searchData="searchDataClick" />
       </div>
       <div
         style="
@@ -120,14 +120,42 @@ export default {
                         }},
       ],
       tableData: [],
-      pageIndex: 1,
-      pageSize: 10,
+      pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+      pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
       total: 0,
     };
   },
+  mounted(){
+     if (localStorage.getItem("list")) {
+      this.list = JSON.parse(localStorage.getItem("list"));
+    }
+    if (localStorage.getItem("searchList")) {
+      this.$nextTick(() => {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      });
+    }
+  },
   methods: {
+    searchDataClick() {
+      this.pageIndex = 1;
+      this.pageSize = 10;
+      let row = {};
+      this.list.forEach((e) => {
+        if (e.serverName == "project_number") {
+          this.$set(row, "project_number", e.value);
+        }
+        if (e.serverName == "project_name") {
+          this.$set(row, "project_name", e.value);
+        }
+        if (e.serverName == "abbreviation") {
+          this.$set(row, "abbreviation", e.value);
+        }
+        // this.$set(对象, key, 数组);
+      });
+      localStorage.setItem("searchList", JSON.stringify(row));
+      this.initData(row);
+    },
     initData(row) {
-      console.log(row)
       this.axios.get('/api/cut_order_list',{params:{
         page_index:this.pageIndex,
         page_size:this.pageSize,
@@ -153,6 +181,9 @@ export default {
          
     },
     gotoPage(type,row){
+      localStorage.setItem("list", JSON.stringify(this.list));
+      localStorage.setItem("pageSize", this.pageSize);
+      localStorage.setItem("pageIndex", this.pageIndex);
       //1 编辑 2 查看 3 新增
       switch(type){
         case 1:
@@ -164,11 +195,19 @@ export default {
     },
     changeSize (e) {
       this.pageSize = e;
-      this.initData()
+      if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
      changePage (e) {
       this.pageIndex = e;
-      this.initData()
+      if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
   },
 };

+ 5 - 0
src/views/leadMatch/roomList/list.vue

@@ -24,8 +24,13 @@ export default {
         to.path == "/cms/leadMatch/roomList/HXYedit" || 
         to.path == "/cms/leadMatch/roomList/BSTedit"
       ) {
+        from.meta.keepAlive = false;
         next();
       } else {
+        localStorage.removeItem("list");
+        localStorage.removeItem("pageSize");
+        localStorage.removeItem("pageIndex");
+        localStorage.removeItem("searchList");
         from.meta.keepAlive = false;
         next();
       }

+ 25 - 3
src/views/leadMatch/weightMemo/BSTlist.vue

@@ -5,7 +5,7 @@
     </Toptitle>
     <div class="weight_memo_content">
       <div>
-        <Topsearch :list="list" @init="initData" @searchData="initData" />
+        <Topsearch :list="list" @init="initData" @searchData="searchData" />
       </div>
       <div
         style="
@@ -120,12 +120,31 @@ export default {
                         }},
       ],
       tableData: [],
-      pageIndex: 1,
-      pageSize: 10,
+      pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+      pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
       total: 0,
     };
   },
   methods: {
+    searchData(){
+      this.pageIndex = 1;
+      this.pageSize = 10;
+      let row = {};
+      this.list.forEach((e) => {
+        if (e.serverName == "project_number") {
+          this.$set(row, "project_number", e.value);
+        }
+        if (e.serverName == "project_name") {
+          this.$set(row, "project_name", e.value);
+        }
+        if (e.serverName == "abbreviation") {
+          this.$set(row, "abbreviation", e.value);
+        }
+        // this.$set(对象, key, 数组);
+      });
+      localStorage.setItem("searchList", JSON.stringify(row));
+      this.initData(row);
+    },
     initData(row) {
       this.axios.get('/api/cut_order_list',{params:{
         page_index:this.pageIndex,page_size:this.pageSize,
@@ -150,6 +169,9 @@ export default {
        
     },
     gotoPage(type,row){
+      localStorage.setItem("list", JSON.stringify(this.list));
+      localStorage.setItem("pageSize", this.pageSize);
+      localStorage.setItem("pageIndex", this.pageIndex);
       //1 编辑 2 查看 3 新增
       switch(type){
         case 1:

+ 216 - 92
src/views/leadMatch/weightMemo/HXYlist.vue

@@ -5,7 +5,7 @@
     </Toptitle>
     <div class="weight_memo_content">
       <div>
-        <Topsearch :list="list" @init="initData" @searchData="initData"/>
+        <Topsearch :list="list" @init="initData" @searchData="searchData" />
       </div>
       <div
         style="
@@ -15,27 +15,33 @@
           padding-top: 10px;
         "
       >
-        <Button type="primary" size="small" style="margin-right: 10px" @click="gotoPage(3)"
+        <Button
+          type="primary"
+          size="small"
+          style="margin-right: 10px"
+          @click="gotoPage(3)"
           >新增</Button
         >
       </div>
       <Table :columns="tableColumns" border :data="tableData">
-        <template slot="make_data" slot-scope="{row}">
-          <span>{{func.replaceDate(row.crt_time)}}</span>
+        <template slot="make_data" slot-scope="{ row }">
+          <span>{{ func.replaceDate(row.crt_time) }}</span>
         </template>
-     </Table>
+      </Table>
+    </div>
+    <div class="content_body_page">
+      <Page
+        :page-size-opts="[10, 20, 30, 40, 100]"
+        @on-page-size-change="changeSize"
+        @on-change="changePage"
+        :current="pageIndex"
+        show-total
+        show-elevator
+        :total="total"
+        show-sizer
+        :page-size="pageSize"
+      />
     </div>
-      <div class="content_body_page">
-          <Page :page-size-opts="[10, 20, 30, 40,100]"
-                @on-page-size-change='changeSize'
-                @on-change='changePage'
-                :current='pageIndex'
-                show-total
-                show-elevator
-                :total="total"
-                show-sizer
-                :page-size='pageSize' />
-        </div>
   </div>
 </template>
 <script>
@@ -49,7 +55,7 @@ export default {
           value: "",
           placeholder: "请输入项目编号",
           serverName: "project_number",
-          size:'default'
+          size: "default",
         },
         {
           title: "项目名称",
@@ -57,7 +63,7 @@ export default {
           value: "",
           placeholder: "请输入项目名称",
           serverName: "project_name",
-          size:'default'
+          size: "default",
         },
         {
           title: "项目简称",
@@ -65,7 +71,7 @@ export default {
           value: "",
           placeholder: "请输入项目简称",
           serverName: "abbreviation",
-          size:'default'
+          size: "default",
         },
         // {
         //   title: "匹配状态",
@@ -77,109 +83,227 @@ export default {
         //     { label: "匹配完成", value: 2 },
         //     { label: "未匹配", value: 0 },
         //      { label: "匹配中", value: 1 },
-        //   ] 
+        //   ]
         // },
       ],
       tableColumns: [
-        { title: "项目编码", key: "project_number", align: "center" , resizable: true,
-                        width: 350},
-        { title: "项目名称", key: "project_name", align: "center",  resizable: true,
-                        width: 350 },
-        { title: "项目简称", key: "abbreviation", align: "center", resizable: true,
-                        width: 350},
+        {
+          title: "项目编码",
+          key: "project_number",
+          align: "center",
+          resizable: true,
+          width: 350,
+        },
+        {
+          title: "项目名称",
+          key: "project_name",
+          align: "center",
+          resizable: true,
+          width: 350,
+        },
+        {
+          title: "项目简称",
+          key: "abbreviation",
+          align: "center",
+          resizable: true,
+          width: 350,
+        },
         // { title: "匹配状态", key: "state", align: "center", minWidth: 140,
         // render:(h,params)=>{
         //   return h('span',{},params.row.state===0?'未匹配':params.row.state===2?'匹配完成':'匹配中')
         // }},
-        { title: "制单日期", key: "make_data", align: "center",  resizable: true,
-                        width: 350,slot:"make_data"},
-        { title: "操作", key:'',align: "center", minWidth:150,
-         render: (h, params) => {
-                            return h('div', [
-                                h('a', { style: {
-                                        marginRight: '5px'
-                                    }, on: {
-                                        click: () => {
-                                            this.gotoPage(1,params.row)
-                                        }
-                                    }
-                                    }, '编辑'),
-                                h('a', { style: {
-                                        marginRight: '5px'
-                                    }, on: {
-                                        click: () => {
-                                            this.gotoPage(2,params.row)
-                                        }
-                                    }
-                                    }, '查看'),
-                                h('a',{ style: {
-                                        marginRight: '5px'
-                                    }, on: {
-                                        click: () => {
-                                            this.del(params.row)
-                                        }
-                                    }},'删除')
-                            ]);
-                        }},
+        {
+          title: "制单日期",
+          key: "make_data",
+          align: "center",
+          resizable: true,
+          width: 350,
+          slot: "make_data",
+        },
+        {
+          title: "操作",
+          key: "",
+          align: "center",
+          minWidth: 150,
+          render: (h, params) => {
+            return h("div", [
+              h(
+                "a",
+                {
+                  style: {
+                    marginRight: "5px",
+                  },
+                  on: {
+                    click: () => {
+                      this.gotoPage(1, params.row);
+                    },
+                  },
+                },
+                "编辑"
+              ),
+              h(
+                "a",
+                {
+                  style: {
+                    marginRight: "5px",
+                  },
+                  on: {
+                    click: () => {
+                      this.gotoPage(2, params.row);
+                    },
+                  },
+                },
+                "查看"
+              ),
+              h(
+                "a",
+                {
+                  style: {
+                    marginRight: "5px",
+                  },
+                  on: {
+                    click: () => {
+                      this.del(params.row);
+                    },
+                  },
+                },
+                "删除"
+              ),
+            ]);
+          },
+        },
       ],
       tableData: [],
-      pageIndex: 1,
-      pageSize: 10,
+      pageIndex: JSON.parse(localStorage.getItem("pageIndex")) || 1,
+      pageSize: JSON.parse(localStorage.getItem("pageSize")) || 10,
       total: 0,
     };
   },
+  mounted() {
+    if (localStorage.getItem("list")) {
+      this.list = JSON.parse(localStorage.getItem("list"));
+    }
+    if (localStorage.getItem("searchList")) {
+      this.$nextTick(() => {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      });
+    }
+  },
+  // beforeRouteLeave(to, from, next) {
+  //   if (to.path == "/cms/leadMatch/weightMemo/HXYedit") {
+  //     from.meta.keepAlive = false;
+  //     localStorage.setItem("list", JSON.stringify(this.list));
+  //     localStorage.setItem("pageSize", this.pageSize);
+  //     localStorage.setItem("pageIndex", this.pageIndex);
+  //     next();
+  //   } else {
+  //     localStorage.removeItem("list");
+  //     localStorage.removeItem("pageSize");
+  //     localStorage.removeItem("pageIndex");
+  //     from.meta.keepAlive = false;
+  //     next();
+  //   }
+  // },
   methods: {
+    searchData() {
+      this.pageIndex = 1;
+      this.pageSize = 10;
+      let row = {};
+      this.list.forEach((e) => {
+        if (e.serverName == "project_number") {
+          this.$set(row, "project_number", e.value);
+        }
+        if (e.serverName == "project_name") {
+          this.$set(row, "project_name", e.value);
+        }
+        if (e.serverName == "abbreviation") {
+          this.$set(row, "abbreviation", e.value);
+        }
+        // this.$set(对象, key, 数组);
+      });
+      localStorage.setItem("searchList", JSON.stringify(row));
+      this.initData(row);
+    },
     initData(row) {
-      this.axios.get('/api/cut_order_list',{params:{
-        page_index:this.pageIndex,page_size:this.pageSize,
-        order_type:1,
-        ...row}}).then(res=>{
-        this.tableData = res.data.data;
-        this.total = res.data.total
-      })
+      this.axios
+        .get("/api/cut_order_list", {
+          params: {
+            page_index: this.pageIndex,
+            page_size: this.pageSize,
+            order_type: 1,
+            ...row,
+          },
+        })
+        .then((res) => {
+          this.tableData = res.data.data;
+          this.total = res.data.total;
+        });
     },
-    del(row){
+    del(row) {
       this.confirmDelete({
-                content:'是否删除?',
-                title:'码单删除',
-                type:'primary',
-                then:()=>{
-                       this.axios.post('/api/cut_order_delete',{cut_order_id:row.id,order_type:1}).then(()=>{
-            this.initData()
-          })
-                },
-                cancel:()=>{}
+        content: "是否删除?",
+        title: "码单删除",
+        type: "primary",
+        then: () => {
+          this.axios
+            .post("/api/cut_order_delete", {
+              cut_order_id: row.id,
+              order_type: 1,
             })
-       
+            .then(() => {
+              this.initData();
+            });
+        },
+        cancel: () => {},
+      });
     },
-    gotoPage(type,row){
+    gotoPage(type, row) {
+      localStorage.setItem("list", JSON.stringify(this.list));
+      localStorage.setItem("pageSize", this.pageSize);
+      localStorage.setItem("pageIndex", this.pageIndex);
       //1 编辑 2 查看 3 新增
-      switch(type){
+      switch (type) {
         case 1:
-          case 2:this.$router.push({ path: '/cms/leadMatch/weightMemo/HXYedit', query: { type:type,cut_order_id:row.id} });
-          break
-          case 3:this.$router.push({ path: '/cms/leadMatch/weightMemo/HXYedit', query: { type:type} });
-          break
+        case 2:
+          this.$router.push({
+            path: "/cms/leadMatch/weightMemo/HXYedit",
+            query: { type: type, cut_order_id: row.id },
+          });
+          break;
+        case 3:
+          this.$router.push({
+            path: "/cms/leadMatch/weightMemo/HXYedit",
+            query: { type: type },
+          });
+          break;
       }
     },
-    changeSize (e) {
+    changeSize(e) {
       this.pageSize = e;
-      this.initData()
+        if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
-     changePage (e) {
+    changePage(e) {
       this.pageIndex = e;
-      this.initData()
+        if (localStorage.getItem("searchList")) {
+        this.initData(JSON.parse(localStorage.getItem("searchList")));
+      }else{
+        this.initData()
+      } 
     },
   },
 };
 </script>
 <style scoped lang='scss'>
-.weight_memo_content{
-    height: 80%;
-    overflow: auto;
+.weight_memo_content {
+  height: 80%;
+  overflow: auto;
 }
-.content_body_page{
-    margin-top: 10px;
-    text-align: center;
+.content_body_page {
+  margin-top: 10px;
+  text-align: center;
 }
 </style>

+ 5 - 0
src/views/leadMatch/weightMemo/list.vue

@@ -23,9 +23,14 @@ export default {
       if (
         to.path == "/cms/leadMatch/weightMemo/HXYedit" || to.path == "/cms/leadMatch/weightMemo/BSTedit"
       ) {
+         from.meta.keepAlive = false;
         next();
       } else {
         from.meta.keepAlive = false;
+        localStorage.removeItem("list");
+        localStorage.removeItem("pageSize");
+        localStorage.removeItem("pageIndex");
+        localStorage.removeItem("searchList");
         next();
       }
     },