|
|
@ -34,9 +34,10 @@ |
|
|
|
<el-button>重置</el-button> |
|
|
|
<el-button>重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<el-button>批量上架</el-button> |
|
|
|
<el-button @click="changeProductStatus(item)" v-for="item in dict.type.product_status" :key="item.value">批量{{ |
|
|
|
<el-button>批量下架</el-button> |
|
|
|
item.label |
|
|
|
<el-table :data="dataList" class="table"> |
|
|
|
}}</el-button> |
|
|
|
|
|
|
|
<el-table :data="dataList" class="table" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" align="center"></el-table-column> |
|
|
|
<el-table-column label="商品编码" align="center"> |
|
|
|
<el-table-column label="商品编码" align="center"> |
|
|
|
DS000001 |
|
|
|
DS000001 |
|
|
@ -81,12 +82,14 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex' |
|
|
|
import { mapState } from 'vuex' |
|
|
|
|
|
|
|
import ElInputPlus from '@/views/components/el-input-plus' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'StoreGoods', |
|
|
|
name: 'StoreGoods', |
|
|
|
dicts: ['shop_type', 'product_status'], |
|
|
|
dicts: ['shop_type', 'product_status'], |
|
|
|
|
|
|
|
components: { ElInputPlus }, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
dataList: [{}], |
|
|
|
dataList: [{ shopCode: undefined }], |
|
|
|
// |
|
|
|
// |
|
|
|
total: 1, |
|
|
|
total: 1, |
|
|
|
//查询参数 |
|
|
|
//查询参数 |
|
|
@ -99,10 +102,48 @@ export default { |
|
|
|
productCategory: undefined, |
|
|
|
productCategory: undefined, |
|
|
|
shopType: undefined, |
|
|
|
shopType: undefined, |
|
|
|
productStatus: undefined |
|
|
|
productStatus: undefined |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
form: { |
|
|
|
|
|
|
|
cause: '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
handleSelectionChange(selection) { |
|
|
|
|
|
|
|
this.shopCodes = selection.map(item => item.shopCodes); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//上下架 |
|
|
|
|
|
|
|
changeProductStatus(status) { |
|
|
|
|
|
|
|
if (this.shopCodes.length === 0) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let self = this |
|
|
|
|
|
|
|
if (status.label === '下架') { |
|
|
|
|
|
|
|
const h = this.$createElement; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let inputPlus = h('el-input-plus', { |
|
|
|
|
|
|
|
on: { |
|
|
|
|
|
|
|
'update:value': function (value) { |
|
|
|
|
|
|
|
self.form.cause = value |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
key: 'fuck' + Math.random(), |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$confirm(inputPlus, `确定下架这${this.shopCodes.length}件商品?`, { |
|
|
|
|
|
|
|
confirmButtonText: '下架' |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
console.info(self.form.cause) |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$modal.confirm(`确定上架这${this.shopCodes.length}件商品?`).then(action => { |
|
|
|
|
|
|
|
console.debug('confirm') |
|
|
|
|
|
|
|
}).catch(action => { |
|
|
|
|
|
|
|
console.debug('cancel') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
querySearch() { |
|
|
|
querySearch() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|