batchUp.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div>
  3. <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`批量上架`)}}</el-button>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: "batchUp",
  9. props:["rowData","disabled"],
  10. methods:{
  11. onshow(){
  12. this.onBatchUp()
  13. },
  14. onBatchUp(){
  15. this.$confirm(this.$t('确定上架这些商品吗')+'?', this.$t('提示'), {
  16. confirmButtonText: this.$t('确定'),
  17. cancelButtonText: this.$t('取消'),
  18. type: 'warning'
  19. }).then(async () => {
  20. let row = []
  21. this.rowData.forEach(function (item,index) {
  22. row[index] = item.sc_points_productid
  23. })
  24. const res = await this.$api.requested({
  25. "id": 2026052209114006,
  26. "content": {
  27. "sc_points_productids": row.join(",")
  28. },
  29. })
  30. this.tool.showMessage(res,()=>{
  31. this.$emit('batchUpSuccess')
  32. })
  33. }).catch(async () => {
  34. this.$message({
  35. type: 'info',
  36. message: this.$t('已取消批量上架')
  37. });
  38. });
  39. }
  40. }
  41. }
  42. </script>
  43. <style scoped>
  44. </style>