Pārlūkot izejas kodu

商品下线查询,列表、详情开发

lucky 2 gadi atpakaļ
vecāks
revīzija
c2cf39f4b4

+ 17 - 0
src/apis/service/goodStore/goodsOffline/index.js

@@ -0,0 +1,17 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+
+  // 分页查询
+  list: (data, params) => http(api + "gooduplist", data, "post", params),
+
+  // 详情
+  goodoffdetail: (data, params) => http(api + "goodoffdetail", data, "post", params),
+
+
+  // 商品下线列表---------------
+  goodofflist: (data, params) => http(api + "goodofflist", data, "post", params),
+
+
+};

+ 2 - 2
src/config/env.development.js

@@ -10,8 +10,8 @@ module.exports = {
     userApi: 'http://inv.test241.wanyuhengtong.com/',
     baseApi: 'http://stock.test241.wanyuhengtong.com/',
 
-    // userApi: 'http://inv.sitw.wanyuhengtong.com/',
-    // baseApi: 'http://stock.api.wanyuhengtong.com/',
+    //  userApi: 'http://inv.sitw.wanyuhengtong.com/',
+    //  baseApi: 'http://stock.api.wanyuhengtong.com/',
   },
   webUrl:'http://share.sitw.wanyuhengtong.com/#/test-good-share?id=',
   fileURL: `https://api2.edusit.zretchome.com`,

+ 55 - 54
src/views/goodStore/goodsOffline/columns.js

@@ -1,95 +1,96 @@
-//未签收报
-const table5 = [
+//
+const columns = [
     // {
     //   type: "expand",
     //   _slot_: "expand",
     //   fixed: "left",
     //   _noset_: true,
     // },
+    // {
+    //   type: "selection",
+    //   fixed: "left",
+    //   _noset_: true
+    // },
     {
-      type: "selection",
-      fixed: "left",
-      _noset_: true
-    },
-    {
-      prop: "apply_name",
-      label: "创建人",
+      prop: "id",
+      label: "ID",
       minWidth: "155px",
     },
     {
-      prop: "creater_company",
-      label: "创建人部门",
+      prop: "spuCode",
+      label: "spuCode",
       minWidth: "155px",
     },
     {
-      prop: "addtime",
-      label: "下单时间",
+      prop: "good_name",
+      label: "下线商品名称",
       minWidth: "155px",
     },
   
     {
-      prop: "orderCode",
-      label: "订单号",
+      prop: "creater",
+      label: "操作人",
       minWidth: "155px",
     },
     {
-      prop: "first_customer_org",
-      label: "一级企业",
+      prop: "addtime",
+      label: "下线时间",
       minWidth: "155px",
     },
     {
-      prop: "second_customer_org",
-      label: "二级企业",
-      minWidth: "155px",
-    },
+      prop: "",
+
+      label: "操作",
+      fixed: "right",
+      _noset_: true,
+      _slot_:'operation',
+      minWidth: "45px",
+
+    }
+  ]
+  //详情
+  const costArr = [
     {
-      prop: "companyName",
-      label: "客户名称",
-      minWidth: "155px",
+      prop: "spuCode",
+      label: "spuCode",
+      span: 12
     },
     {
-      prop: "good_name",
-      label: "产品名称",
-      minWidth: "155px",
+      prop: "skuCodes",
+      label: "skuCode",
+      span: 12
     },
     {
-      prop: "good_num",
-      label: "数量",
-      minWidth: "155px",
+      prop: "good_name",
+      label: "商品名称",
+      span: 12
     },
+   
+  
     {
-      prop: "unit",
-      label: "单位",
-      minWidth: "155px",
+      prop: "creater",
+      label: "操作人",
+      span: 6
     },
+    
     {
-      prop: "sale_price",
-      label: "单价",
-      minWidth: "155px",
+      prop: "result_desc",
+      label: "下线原因",
+      span: 6
     },
     {
-      prop: "total_price",
-      label: "金额",
-      minWidth: "155px",
+      prop: "addtime",
+      label: "下线时间",
+      span: 24
     },
-  
     {
-      prop: "sendtime",
-      label: "发货时间",
-      minWidth: "155px",
+      prop: "offline_remark",
+      label: "下线备注",
+      span: 24
     },
-    {
-      prop: "",
-
-      label: "操作",
-      fixed: "right",
-      _noset_: true,
-      _slot_:'operation',
-      minWidth: "45px",
-
-    }
   ]
 
   export {
-    table5
+    columns,
+    costArr,
   }

+ 82 - 4
src/views/goodStore/goodsOffline/detail.vue

@@ -1,13 +1,91 @@
 <template>
-  <div>w(゚Д゚)w</div>
+  <div class="box">
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+    <el-tab-pane label="商品下线详情" name="1">
+
+      <show-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="list"
+                :columns="costArr"
+              >
+              </show-data-table>
+    </el-tab-pane>
+  </el-tabs>
+  </div>
 </template>
 
 <script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/goodStore/goodsOffline";
+import { costArr} from "./columns";
+import { mapGetters } from "vuex";
 export default {
-
+  name: "goodsOfflineDetail",
+  mixins: [mixinPage, resToken],
+  components: {
+  },
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      let tran =
+        this.$store.getters.btnList.find((item) => item.menu_route == "goodsOfflineDetail") ||
+        {};
+      if (tran && tran.action && tran.action.length > 0) {
+        return tran.action;
+      } else {
+        return [];
+      }
+    },
+    
+  },
+  data(){
+    return {
+      //loading
+      loading: false,
+      //数据
+      list:{},
+      parmValue:{
+        id:this.$route.query.id
+      },
+      activeName: '1',
+      newTime: "",  
+      costArr,
+      
+    }
+  },
+  mounted(){
+    
+    this.searchList();  
+  },
+  methods:{
+    async searchList(){
+      this.loading = true;
+      
+      const res = await asyncRequest.goodoffdetail(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.list = res.data;
+        console.log(this.list)
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message)
+        this.list = [];
+      }
+      this.getNewTime();
+      this.loading = false;
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+  }
 }
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+  .box{
+    padding: 20px 20px 0;
+    box-sizing: border-box;
+  }
 </style>

+ 47 - 86
src/views/goodStore/goodsOffline/index.vue

@@ -4,7 +4,7 @@
         v-loading="loading"
         :table="table"
         :data="tableData"
-        :columns="table5"
+        :columns="columns"
         :page="pageInfo"
         :size="size"
         @page-curr-change="handlePageChange"
@@ -35,11 +35,20 @@
                       @timeReturned="time"
                     />
               </el-col>  
-              <el-col :span="4" style="width: 66px; float: right">       
-                <el-button type="primary" style="margin-left:30px;" @click="download" :size="searchSize"  class="fr">
-                    导出
-                </el-button>
-              </el-col>
+              <el-col :span="6" style="width: 163px;">
+                <el-input
+                :size="searchSize"
+                v-model="parmValue.creater"
+                :maxlength="40"
+                @blur="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+                placeholder="创建人"
+                ></el-input> 
+              </el-col>  
+              
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   :size="searchSize"
@@ -73,7 +82,7 @@
         >
           <i
             class="el-icon-view tb-icon"
-            @click="getRouter('goodsOfflineDetail', scope.row.orderCode)"
+            @click="getRouter('goodsOfflineDetail', scope.row.id)"
           ></i>
         </el-tooltip>
     
@@ -88,13 +97,13 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import urlConfig from "@/apis/url-config";
-import asyncRequest from "@/apis/service/reportQuery/saleReport";
+import asyncRequest from "@/apis/service/goodStore/goodsOffline";
 import periodDatePickerActive from "./period-date-picker/main.vue";
-import { table5} from "./columns";
+import { columns} from "./columns";
 import { mapGetters } from "vuex";
 
 export default {
-  name: "saleReport",
+  name: "goodsOffline",
   mixins: [mixinPage, resToken],
   components: {
     periodDatePickerActive
@@ -127,7 +136,7 @@ export default {
         start_date: "", //起始时间
         end_date: "", // 结束时间
         // is_export:0,//是否导出0/1
-
+        creater:"",//创建人
         page: 1, // 页码
         size: 15, // 每页显示条数
        
@@ -147,11 +156,31 @@ export default {
         total: 0,
       },
       // 表格表头 - 列参数
-      table5: table5,
+      columns: columns,
     };
   },
   mounted() {
-    alert("此页面暂时只用做开发人员测试、数据不真实")
+    // alert("此页面暂时只用做开发人员测试、数据不真实")
+    const { back } = this.$route.query;
+
+     if (back) {
+      this.parmValue = JSON.parse(back);
+      console.log(this.parmValue);
+      const { page, size } = this.parmValue;
+
+      this.pageInfo = {
+        size: size,
+        curr: page,
+        total: 0,
+      };
+      //多选条件
+      // this.select = this.parmValue.select;
+      // this.sselect = this.parmValue.sselect;
+      // this.sinput = this.parmValue.sinput;
+    } else {
+      // this.select = "1";
+      //  this.sselect = "创建时间"
+    }
     this.searchList();
   },
 
@@ -190,10 +219,11 @@ export default {
         return;
       }
       this.loading = true;
-      
-      const res = await asyncRequest.saleexportnotsigned(this.parmValue);
+      console.log(this.parmValue)
+      const res = await asyncRequest.goodofflist(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
+        
         this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
@@ -210,6 +240,7 @@ export default {
       this.parmValue = {
         start_date: "", //新建起始时间
         end_date: "", // 新建结束时间
+        creater:"",//创建人
         // is_export:0,//是否导出0/1
         page: 1, // 页码
         size: 15, // 每页显示条数
@@ -245,77 +276,7 @@ export default {
       //选中的数组集合
       this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
     },
-    //导出文件 
-    async download() {
-      // if(this.changeList.length<=0){
-      //   this.$message.warning("请选择有效数据")
-      //   return;
-      // }
-      let model = JSON.parse(JSON.stringify(this.parmValue))
-      // model.is_export = 1;
-      let start_date = new Date(this.parmValue.start_date).valueOf();
-      let end_date = new Date(this.parmValue.end_date).valueOf();
-      let flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
-      if(this.parmValue.start_date != "" && this.parmValue.end_date != ""){
-        if(flag){
-          this.$message.warning("导出文件的时间区间不能超过30天")
-          return;
-        }
-      }else{
-        this.$message.warning("请选择导出文件的时间区间")
-        return;
-      }
-      if (!this.loading) {
-        this.loading = true;
-        let httpType = `aplication/zip`;
-        axios({
-          method: "post",
-          url: this.fileUrl + "admin/saleexportnotsignedexport",
-          responseType: "blob",
-          data: model,
-          headers: {
-            // 'Content-Type': 'multipart/form-data',
-            // Accept: "application/vnd.ms-excel"
-            Accept: httpType,
-          },
-        })
-          .then((res) => {
-            // console.log(res)
-            // console.log(this.fileUrl)
-            // return;
-            if (res && res.status == 200 && res.data) {
-              let url = window.URL.createObjectURL(
-                new Blob([res.data], {
-                  // type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
-                  type: httpType
-                })
-              );
-              let link = document.createElement("a");
-              link.style.display = "none";
-              link.href = url;
-              let excelName = "未签收报表.zip";
-              link.setAttribute("download", excelName);
-              document.body.appendChild(link);
-              link.click();
-              link.remove();
-              window.URL.revokeObjectURL(url); //释放掉blob对象
-              this.$message.success(`导出成功!`);
-              setTimeout(() => {
-                this.loading = false;
-              }, 500);
-            } else {
-              this.$message.error(res.data.message);
-              setTimeout(() => {
-                this.loading = false;
-              }, 500);
-            }
-          })
-          .catch((error) => {
-            console.log(error);
-            this.loading = false;
-          });
-      }
-    },
+
   },
 };
 </script>