Bladeren bron

新建采反有效期修改最小值为1,商品上线管理增加导出弹窗及功能,修改点击跳转详情页返回后重置无效问题

lucky 2 jaren geleden
bovenliggende
commit
56cf5e4e65

+ 4 - 0
src/apis/service/goodStore/goodsOnline/index.js

@@ -35,4 +35,8 @@ export default {
   // 规格属性值新建
   specinfoadd: (data, params) => http(api + "specinfoadd", data, "post", params),
 
+  //导出线上商品
+  exportgood: (data, params) => http(api + "exportgood", data, "post", params),
+
+
 };

+ 2 - 0
src/views/goodStore/active/index.vue

@@ -316,6 +316,8 @@ export default {
     },
     restSearch() {
       // 表格 - 分页
+      this.select = "1";
+      this.sinput = "";
       this.pageInfo = {
         size: 15,
         curr: 1,

+ 1 - 0
src/views/goodStore/goodsCost/index.vue

@@ -528,6 +528,7 @@ export default {
     },
     restSearch() {
       this.select = "1";
+      this.sinput = ""
       this.supplierNo = [];
       this.brandid = [];
       // 表格 - 分页

+ 198 - 28
src/views/goodStore/goodsOnline/index.vue

@@ -89,7 +89,7 @@
           </el-row>
 
           <el-row>
-            <el-col :span="4" style="width: 200px">
+            <el-col :span="4" style="width: 150px">
               <el-select
                 v-model="parmValue.exam_status"
                 filterable
@@ -111,7 +111,7 @@
                 />
               </el-select>
             </el-col>
-            <el-col :span="4" style="width: 240px; padding: 0 0 0 10px">
+            <el-col :span="4" style="width: 210px; padding: 0 0 0 10px">
               <search-brand
                 :value="brandid"
                 :disabled="false"
@@ -123,7 +123,7 @@
               />
             </el-col>
 
-            <el-col :span="4" style="width: 470px; padding: 0 0 0 10px">
+            <el-col :span="4" style="width: 430px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
                 v-model="sinput"
@@ -148,7 +148,7 @@
                 >
                   <el-option label="商品名称" value="1" />
                   <el-option label="成本商品编号" value="2" />
-                    <el-option label="上线商品编号" value="8" />
+                  <el-option label="上线商品编号" value="8" />
                   <!-- <el-option label="平台编号" value="3" /> -->
                   <!-- <el-option label="供应商编号" value="4" /> -->
                   <el-option label="业务企业编号" value="5" />
@@ -171,6 +171,22 @@
                 添加
               </el-button>
             </el-col>
+
+            <el-col
+              :span="3"
+              class="fr"
+              style="width: 66px; padding: 0 0 0 10px"
+              v-if="powers.some((item) => item == '087')"
+            >
+              <el-button
+                :size="searchSize"
+                type="primary"
+                style="float: right"
+                @click="centerDialogVisible = true"
+              >
+                导出上线商品
+              </el-button>
+            </el-col>
           </el-row>
         </div></template
       >
@@ -224,8 +240,7 @@
         >
           <i
             class="el-icon-view tb-icon"
-            
-             @click="getRouter('goodsOnlineDetail', scope.row.skuCode )"
+            @click="getRouter('goodsOnlineDetail', scope.row.skuCode)"
           ></i>
         </el-tooltip>
         <el-tooltip
@@ -258,6 +273,56 @@
       </template>
     </ex-table>
     <no-auth v-else></no-auth>
+    <el-dialog
+      title="上线商品导出"
+      :visible.sync="centerDialogVisible"
+      width="500px"
+      center
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        class="demo-ruleForm"
+        label-width="80px"
+      >
+        <el-form-item prop="date" label="日期: ">
+          <el-date-picker
+            value-format="yyyy-MM-dd"
+            v-model="ruleForm.date"
+            type="date"
+            placeholder="请选择"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="状态: " prop="status">
+          <el-select v-model="ruleForm.status" placeholder="请选择">
+            <el-option label="待上线" value="5"></el-option>
+            <el-option label="上线成功" value="6"></el-option>
+            <el-option label="已下线" value="8"></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="平台id: " prop="platform_id">
+          <!-- <el-input
+            v-model="ruleForm.platform_id"
+            style="width: 300px"
+            placeholder="请输入"
+          ></el-input> -->
+          <search-terrace
+            :value="ruleForm.platform_id"
+            :disabled="false"
+            :isDetail="false"
+            :placeholder="'所属平台'"
+            @searchChange="platform_codesearchChange"
+          />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="centerDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="goodsExport">导 出</el-button>
+      </span>
+    </el-dialog>
     <!-- 弹窗 新增/修改 -->
     <add-edit
       :id="modelId"
@@ -272,6 +337,7 @@
 import asyncRequest from "@/apis/service/goodStore/goodsOnline";
 import mixinPage from "@/mixins/elPaginationHandle";
 import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
 import resToken from "@/mixins/resToken";
 import { listCol, options1, options8 } from "./columns";
 export default {
@@ -293,14 +359,42 @@ export default {
     },
   },
   data() {
+    var validate = (rule, value, callback) => {
+      if (value == "") {
+        return callback(new Error("必填项不能为空"));
+      } else {
+        callback();
+      }
+    };
     return {
+      fileUrl: urlConfig.baseURL,
+      ruleForm: {
+        date: "",
+        platform_id: "",
+        status: "",
+      },
+      rules: {
+        date: [
+          {
+            validator: validate,
+            type: "date",
+            required: true,
+            trigger: "change",
+          },
+        ],
+        status: [{ validator: validate, required: true, trigger: "change" }],
+        platform_id: [
+          { validator: validate, required: true, trigger: "change" },
+        ],
+      },
+      centerDialogVisible: false,
       options1: options1,
       options8: options8,
       loading: false,
       parmValue: {
         good_name: "", //商品名称
         spucode: "", //商品编号
-         skucode: "", //商品编号
+        skucode: "", //商品编号
         cat_id: "", //商品分类
         start: "", //开始日期
         end: "", //结束日期
@@ -343,26 +437,25 @@ export default {
     const { back } = this.$route.query;
     if (back) {
       this.parmValue = JSON.parse(back);
-      console.log(this.parmValue)
-      const {page,size}=this.parmValue;
+      console.log(this.parmValue);
+      const { page, size } = this.parmValue;
       // this.parmValue.start = start || last_start;
       // this.parmValue.end = end || last_end;
-      if(this.parmValue.brand_id.length>0){
-        this.brandid = [this.parmValue.brand_id] ;
+      if (this.parmValue.brand_id.length > 0) {
+        this.brandid = [this.parmValue.brand_id];
       }
-      
-       this.pageInfo= {
+
+      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.select = this.parmValue.select;
+      // this.sselect = this.parmValue.sselect;
+      this.sinput = this.parmValue.sinput;
+    } else {
+      this.select = "1";
       //  this.sselect = "创建时间"
     }
     this.cat_id = [];
@@ -370,31 +463,108 @@ export default {
     this.searchList();
   },
   methods: {
-    getRouter(toRouter, queryId){
+    platform_codesearchChange(e) {
+      const { id, code, label } = e;
+      this.ruleForm.platform_id = id || "";
+      this.$refs.ruleForm.validateField("platform_id");
+    },
+    //导出
+    async goodsExport() {
+      // console.log(this.$refs.ruleForm)
+      // return;
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (!this.loading) {
+            this.loading = true;
+            let httpType = `aplication/zip`;
+            axios({
+              method: "post",
+              url: this.fileUrl + "admin/exportgood",
+              responseType: "blob",
+              data: this.ruleForm,
+              headers: {
+                Accept: httpType,
+              },
+            })
+              .then((res) => {
+                if (res && res.status == 200 && res.data) {
+                  let url = window.URL.createObjectURL(
+                    new Blob([res.data], {
+                      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;
+              });
+          }
+          // this.loading = true;
+
+          // const res = await asyncRequest.exportgood(this.ruleForm);
+          // if (res && res.code === 0) {
+          //   this.$message.warning(res.message);
+          //   console.log(res);
+          //   this.loading = false;
+          // } else if (res && res.code >= 100 && res.code <= 104) {
+          //   await this.logout();
+          // } else {
+          //   this.loading = false;
+          //   this.$message.warning(res.message);
+          // }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    //点击详情
+    getRouter(toRouter, queryId) {
       if (toRouter && queryId) {
         let model = {
           id: queryId,
-          type: 'view',
+          type: "view",
         };
 
         //有多选框的条件
-        this.parmValue.select = this.select ;
+        this.parmValue.select = this.select;
         // this.parmValue.sselect = this.sselect ;
-        this.parmValue.sinput= this.sinput;
+        this.parmValue.sinput = this.sinput;
         //
-        console.log(this.parmValue)
-         let routerModel = {
+        console.log(this.parmValue);
+        let routerModel = {
           options: JSON.parse(JSON.stringify(this.parmValue)),
           router: this.$route.path,
         };
         model.preModel = JSON.stringify(routerModel);
-        
+
         this.routeGoto(toRouter, model);
       } else {
         this.$message.warning("暂未找到相关流程!");
       }
     },
     restSearch() {
+      this.select = "1";
+      this.sinput = "";
       this.cat_id = [];
       this.brandid = [];
       // 表格 - 分页
@@ -406,7 +576,7 @@ export default {
       this.parmValue = {
         good_name: "", //商品名称
         spucode: "", //商品编号
-         skucode: "", //商品编号
+        skucode: "", //商品编号
         cat_id: "", //商品分类
         start: "", //开始日期
         end: "", //结束日期

+ 2 - 0
src/views/orderEntry/orderEnter/index.vue

@@ -650,6 +650,8 @@ export default {
     },
     //重置按钮
     reset() {
+      this.select = "1";
+    this.inputValue = "";
       this.parmValue = {
         status: "",
         platform_code: "",

+ 6 - 0
src/views/purchaseIn/purchaseDiffOrder/index.vue

@@ -254,6 +254,8 @@ export default {
    
     }else{
        this.select = "cgdNo";
+      this.s_input = "";
+
       //  this.sselect = "创建时间"
     }
     this.searchList();
@@ -299,6 +301,10 @@ export default {
         curr: 1,
         total: 0,
       };
+
+      this.select = "cgdNo";
+      this.s_input = "";
+
       this.searchList();
     },
     // 时间

+ 8 - 7
src/views/purchaseIn/recovery/columns.js

@@ -1,20 +1,21 @@
 const columns = [
   {
-    prop: "infoNo",
+    prop: "zxNo",
     label: "咨询单编号",
+    width: "158px",
+  },
+  {
+    prop: "infoNo",
+    label: "咨询阶梯编号",
     width: "155px",
   },
 
   {
     prop: "bidNo",
-    label: "反馈编号",
-    width: "158px",
-  },
-  {
-    prop: "spuCode",
-    label: "反馈编号",
+    label: "反馈单编号",
     width: "158px",
   },
+  
   {
     prop: "good_name",
     label: "商品名称",

+ 5 - 5
src/views/purchaseIn/workbench/components/baseForm.vue

@@ -82,7 +82,7 @@
           <digital-input
             :values="ruleForm.expire_day"
             :placeholder="'有效期'"
-            :min="0"
+            :min="1"
             :max="100000000000"
             :position="'right'"
             :precision="0"
@@ -1031,7 +1031,7 @@ export default {
           cat_id: cat_id ? [cat_id] : [],
           supplierNo: supplierNo ? [supplierNo] : [],
           pname: good_name || "",
-          expire_day: expire_day || "0", //有效期
+          expire_day: expire_day || "1", //有效期
           delivery_day: delivery_day || "0", //物流时间
           work_day: work_day || "0", //生产工期
           brandid: brand_id ? [brand_id] : [],
@@ -1163,7 +1163,7 @@ export default {
             cat_id: this.type === "add" ? [this.askItem.cat_id] : [],
             supplierNo: [],
             pname: this.type === "add" ? this.askItem.good_name : "",
-            expire_day: "0", //有效期
+            expire_day: "1", //有效期
             delivery_day: "0", //物流时间
             work_day: "0", //生产工期
             brandid: [],
@@ -1425,7 +1425,7 @@ export default {
         cat_id: [],
         supplierNo: [],
         pname: "",
-        expire_day: "0", //有效期
+        expire_day: "1", //有效期
         delivery_day: "0", //物流时间
         work_day: "0", //生产工期
         color: "",
@@ -1470,7 +1470,7 @@ export default {
         cat_id: [],
         supplierNo: [],
         pname: "",
-        expire_day: "0", //有效期
+        expire_day: "1", //有效期
         delivery_day: "0", //物流时间
         work_day: "0", //生产工期
         color: "",

+ 3 - 1
src/views/stock/goodsRepertory/index.vue

@@ -367,6 +367,8 @@ export default {
     restSearch() {
       this.cat_id = [];
       this.brandid = [];
+      this.select = "1",
+      this.sinput = "",
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
@@ -384,7 +386,7 @@ export default {
         is_stock: "", //是否库存品
         min_price: "", //价格区间最小值
         max_price: "", //价格区间最大值
-        moq: 0, //库存数量
+        moq: "", //库存数量
         page: 1, // 页码
         size: 15, // 每页显示条数
         supplierNo: "", //供应商编号