Просмотр исходного кода

商品组管理,新增批量上架、批量下架功能

qymljy 4 месяцев назад
Родитель
Сommit
e8d653f6c6

+ 15 - 5
src/HDrpManagement/ProductGroupMag/index.vue

@@ -14,6 +14,18 @@
       @checkboxCallBack="rows"
       @listData="listData">
       <template #titleRight>
+        <div>
+          <confirmSelection
+              v-if="tool.checkAuth($route.name,'batchUp')"
+              class="inline-16" btnType="primary" btnTitle="批量上架" content="是否确定批量上架所选商品" paramId="20220923143603" @onSuccess="selectChange"
+              idName="sa_itemgroupids" btnSize="small" :selectList="selectList" :disabled="selectList.length == 0" :isBatch="true"></confirmSelection>
+        </div>
+        <div>
+          <confirmSelection
+              v-if="tool.checkAuth($route.name,'batchDown')"
+              class="inline-16" btnType="primary" btnTitle="批量下架" content="是否确定批量下架所选商品" paramId="20220923143703" @onSuccess="selectChange"
+              idName="sa_itemgroupids" btnSize="small" :selectList="selectList" :disabled="selectList.length == 0" :isBatch="true"></confirmSelection>
+        </div>
         <importFile
             v-if="tool.checkAuth($route.name,'export')"
             ref="importFile"
@@ -73,6 +85,7 @@ export default {
         isonsale:''
       },
       errorUrl:null,
+      selectList:[]
     }
   },
   provide() {
@@ -86,8 +99,7 @@ export default {
     this.getBrandList()
   },
   methods: {
-    listData (data) {
-      console.log(data);
+    listData () {
 
     },
     selectChange () {
@@ -125,12 +137,10 @@ export default {
         }
       })
       this.brandList = res.data
-      console.log(this.brandList,'品牌');
     },
     rows(val){
-      console.log("点击")
-      console.log(val)
       this.rowData = val
+      this.selectList = val.map(item=>item.sa_itemgroupid)
     },
     async bindImport (id) {
       const res = await this.$api.requested({

+ 0 - 1
src/HDrpManagement/orderManage/index.vue

@@ -23,7 +23,6 @@
           <p class="search__label">{{$t(`状态`)}}:</p>
           <el-select v-model="where.status2" clearable style="margin-right:10px" size="small" :placeholder="$t(`请选择状态`)" @change="change" multiple>
             <el-option :label="$t(`新建`)" value="新建"></el-option>
-            <el-option :label="$t(`预提交`)" value="预提交"></el-option>
             <el-option :label="$t(`提交`)" value="提交"></el-option>
             <el-option :label="$t(`交期待确认`)" value="交期待确认"></el-option>
             <el-option :label="$t(`交期确认`)" value="交期确认"></el-option>

+ 0 - 1
src/SDrpManagement/agentOrder/index.vue

@@ -18,7 +18,6 @@
           <p class="search__label">{{$t('订单状态')}}:</p>
           <el-select v-model="status" multiple clearable style="margin-right:10px" size="small" :placeholder="$t(`请选择订单状态`)" @change="$refs.basicLayout.param.content.pageNumber = 1 ;$refs.basicLayout.param.content.where.status2 = status;$refs.basicLayout.listData()">
             <el-option value="新建" :label="$t(`新建`)"></el-option>
-            <el-option value="预提交" :label="$t(`预提交`)"></el-option>
             <el-option value="提交" :label="$t(`提交`)"></el-option>
             <el-option value="审核" :label="$t(`审核`)"></el-option>
             <el-option value="交期待确认" :label="$t(`交期待确认`)"></el-option>

+ 0 - 1
src/SDrpManagement/salerOrder/index.vue

@@ -31,7 +31,6 @@
             "
           >
             <el-option :value="$t(`新建`)" :label="$t(`新建`)"></el-option>
-            <el-option :value="$t(`预提交`)" :label="$t(`预提交`)"></el-option>
             <el-option :value="$t(`提交`)" :label="$t(`提交`)"></el-option>
             <el-option :value="$t(`审核`)" :label="$t(`审核`)"></el-option>
             <el-option

+ 22 - 10
src/template/buttonTemplate/confirmSelection.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button :type="disabled?'':btnType" size="mini" :disabled="disabled" @click="open" :showClose="false">{{btnTitle}}</el-button>
+    <el-button :type="disabled?'':btnType" :size="btnSize?btnSize:'mini'" :disabled="disabled" @click="open" :showClose="false">{{btnTitle}}</el-button>
   </div>
 </template>
 
@@ -17,7 +17,10 @@ export default {
     idName:String,
     paramContent:Object,
     disabled:Boolean,
-    statusData:String
+    statusData:String,
+    isBatch:Boolean,
+    selectList:Array,
+    btnSize:String
   },
   data(){
     return {
@@ -46,18 +49,27 @@ export default {
       });
     },
     async onSubmit(){
-      if (this.btnTitle == '暂缓' || this.btnTitle == '取消暂缓' || this.btnTitle == '终止' || this.btnTitle == '恢复'){
-        this.param.id = this.paramId
-        this.param.content = {
-          sa_customersids: [this.$route.query.id],
-          status: this.statusData
+      if (this.isBatch){
+        let content = {
+          [this.idName]:this.selectList
         }
-      }else {
         this.param.id = this.paramId
-        this.param.content = {
-          [this.idName]:this.$route.query.id
+        this.param.content = content
+      }else {
+        if (this.btnTitle == '暂缓' || this.btnTitle == '取消暂缓' || this.btnTitle == '终止' || this.btnTitle == '恢复'){
+          this.param.id = this.paramId
+          this.param.content = {
+            sa_customersids: [this.$route.query.id],
+            status: this.statusData
+          }
+        }else {
+          this.param.id = this.paramId
+          this.param.content = {
+            [this.idName]:this.$route.query.id
+          }
         }
       }
+
       const res = await this.$api.requested(this.param)
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')