马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- <!-- 仓位 -->
- <template>
- <el-select
- clearable
- :value="value || []"
- class="ele-fluid"
- :filterable="true"
- placeholder="仓位"
- @input="updateValue"
- >
- <el-option
- v-for="item in data"
- :key="item.id"
- :value="item.id"
- :label="item.storageName"
- />
- </el-select>
- </template>
- <script>
- // import { listStorage } from '@/api/basic/storage/index';
- import { listStorage } from '@/api/basic/storage';
- export default {
- props: {
- // 选中的数据(v-model)
- value: [Array, String, Number],
- // 提示信息
- placeholder: {
- type: String,
- default: '请选择转入仓位'
- }
- },
- data() {
- return {
- //班次数据
- data: []
- };
- },
- created() {
- listStorage({})
- .then((list) => {
- this.loading = false;
- this.data = list;
- // this.data = this.$util.toTreeData({
- // data: list,
- // idField: 'organizationId',
- // parentIdField: 'parentId'
- // });
- console.log(this.data);
- // this.$nextTick(() => {
- // this.onNodeClick(this.data[0]);
- // });
- })
- .catch((e) => {
- this.loading = false;
- this.$message.error(e.message);
- });
- },
- methods: {
- /* 更新选中数据 */
- updateValue(value) {
- this.$emit('input', value);
- }
- }
- };
- </script>
复制代码 @input="updateValue"
:value="value || []"
|