| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <template>
- <div>
- <el-button :type="disabled?'':'primary'" size="small" @click="onshow" :disabled="disabled">{{$t(`批量上架`)}}</el-button>
- </div>
- </template>
- <script>
- export default {
- name: "batchUp",
- props:["rowData","disabled"],
- methods:{
- onshow(){
- this.onBatchUp()
- },
- onBatchUp(){
- this.$confirm(this.$t('确定上架这些商品吗')+'?', this.$t('提示'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- 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: this.$t('已取消批量上架')
- });
- });
- }
- }
- }
- </script>
- <style scoped>
- </style>
|