Selaa lähdekoodia

修改竞争对手,商品管理新增批量上下架

qymljy 2 vuotta sitten
vanhempi
commit
01ff862c43

+ 1 - 2
src/Form/competitor/add.vue

@@ -112,7 +112,6 @@ export default {
         inferiority:"",
         advantage:"",
         remarks:"",
-        enterpriseid:""
       },
       rules:{
         brandname: [
@@ -209,7 +208,7 @@ export default {
       this.$refs['form'].resetFields()
       this.form = {
         sa_competitorid:0,
-        sys_enterpriseid:"",
+        sys_enterpriseid:0,
         enterprisename:"",
         brandname:"",
         inferiority:"",

+ 31 - 3
src/HDrpManagement/ProductMag/index.vue

@@ -20,7 +20,9 @@
       :isExport="false"
       >
       <template #titleRight>
-        <to_examine v-if="tool.checkAuth($route.name,'toExamine')" class="inline-16" style="margin-left: 10px" :rowData="rowData" @examineSuccess="onSuccess" :disabled="rowData.length === 0"></to_examine>
+        <batchUp class="inline-16" v-if="tool.checkAuth($route.name,'batchUp')" :rowData="rowData" :disabled="rowData.length === 0" @batchUpSuccess="onSuccess"></batchUp>
+        <batchDown class="inline-16" v-if="tool.checkAuth($route.name,'batchDown')" :rowData="rowData" :disabled="rowData.length === 0" @batchUpSuccess="onSuccess"></batchDown>
+        <to_examine v-if="tool.checkAuth($route.name,'toExamine')" class="inline-16"  :rowData="rowData" @examineSuccess="onSuccess" :disabled="rowData.length === 0"></to_examine>
         <counter_examine v-if="tool.checkAuth($route.name,'reverseReview')" class="inline-16" :rowData="rowData" @examineSuccess="onSuccess" :disabled="rowData.length === 0"></counter_examine>
         <priceLevelSetting class="inline-16" v-if="tool.checkAuth($route.name,'priceSet')" ></priceLevelSetting>
         <el-button class="inline-16" size="small" v-if="tool.checkAuth($route.name,'refreshStock')" type="primary" @click="refreshStock">刷新库存</el-button>
@@ -106,6 +108,17 @@
             v-model="selectParam.spec" @keyup.native.enter="selectChange" @clear="selectChange" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
           </el-input>
         </div>
+        <div class="mt-10">
+          <label  class="search__label" >领域:</label>
+          <el-select class="inline-24" v-model="selectParam.tradefield" placeholder="请选择状态" @change="selectChange" size="small" clearable >
+            <el-option
+                v-for="item in tradefieldData"
+                :key="item.value"
+                :label="item.value"
+                :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
       </template>
       <template v-slot:tbList="scope">
         <div>
@@ -174,6 +187,8 @@
 import previewImage from '@/components/previewImage/index'
 import editTemp from './modules/edit.vue'
 import to_examine from './modules/toExamine'
+import batchUp from './modules/batchUp'
+import batchDown from './modules/batchDown'
 import counter_examine from './modules/counterExamine'
 import priceLevelSetting from './modules/priceLevelSetting'
 import importFile from './modules/importFile.vue'
@@ -211,9 +226,11 @@ export default {
         enddate:'',
         status:'',
         model:'',
-        spec:''
+        spec:'',
+        tradefield:''
       },
       rowData:[],
+      tradefieldData:[],
       errorUrl:null,
       dateSelect:'',
     }
@@ -226,7 +243,9 @@ export default {
     priceLevelSetting,
     importFile,
     importImage,
-    importInfo
+    importInfo,
+    batchUp,
+    batchDown
   },
   methods:{
     async isOnSaleChange(val){
@@ -339,7 +358,16 @@ export default {
         message:'刷新成功',
         type:"success"
       })
+    },
+    /*获取领域*/
+    querytradefield(){
+      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+        this.tradefieldData = res.data
+      })
     }
+  },
+  mounted() {
+    this.querytradefield()
   }
 }
 

+ 48 - 0
src/HDrpManagement/ProductMag/modules/batchDown.vue

@@ -0,0 +1,48 @@
+<template>
+  <div>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">批量下架</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "batchDown",
+  props:["rowData","disabled"],
+  methods:{
+    onshow(){
+      this.onBatchUp()
+    },
+    onBatchUp(){
+      this.$confirm('确定下架这些商品吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          row[index] = item.itemid
+        })
+        const res = await this.$api.requested({
+          "id": 20220923154802,
+          "content": {
+            "itemids": row,
+            "isonsale": 0 //0:下架,1:上架
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('batchUpSuccess')
+        })
+      }).catch(async () => {
+        this.$message({
+          type: 'info',
+          message: '已取消批量下架'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 48 - 0
src/HDrpManagement/ProductMag/modules/batchUp.vue

@@ -0,0 +1,48 @@
+<template>
+  <div>
+    <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">批量上架</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "batchUp",
+  props:["rowData","disabled"],
+  methods:{
+    onshow(){
+      this.onBatchUp()
+    },
+    onBatchUp(){
+      this.$confirm('确定上架这些商品吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        let row = []
+        this.rowData.forEach(function (item,index) {
+          row[index] = item.itemid
+        })
+        const res = await this.$api.requested({
+          "id": 20220923154802,
+          "content": {
+            "itemids": row,
+            "isonsale": 1 //0:下架,1:上架
+          },
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('batchUpSuccess')
+        })
+      }).catch(async () => {
+        this.$message({
+          type: 'info',
+          message: '已取消批量上架'
+        });
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 0
src/components/duplicatesCheck/competitorCheck.vue

@@ -102,6 +102,7 @@ export default {
       });
     },
     async onSubmit(){
+      this.data.sys_enterpriseid = 0
       const res = await this.$api.requested({
         "id": 20221018164102,
         "content": this.data

+ 1 - 1
vue.config.js

@@ -11,7 +11,7 @@ module.exports = {
       open: true,
       // host: '192.168.4.170',
       host: 'oms.idcgroup.com.cn',
-      port: 8087,
+      port: 8000,
       proxy: {
         '/apis': {
           target: 'http://61.164.207.46:8000',  // target host*/