| @ -0,0 +1,98 @@ | |||
| <!-- 存储位置选择器 --> | |||
| <template> | |||
| <div> | |||
| <el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable"> | |||
| <el-option v-for="item in list" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel" /> | |||
| </el-select> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import { listData } from "@/api/system/dict/data" | |||
| export default { | |||
| name: "SelectCcwz", | |||
| components: {}, | |||
| props: { | |||
| value: { | |||
| type: [Number, String , Array], | |||
| default: '', | |||
| }, | |||
| readonly: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| multiple: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| filterable: { | |||
| type: Boolean, | |||
| default: true | |||
| }, | |||
| placeholder: { | |||
| type: String, | |||
| default: '' | |||
| } | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| if(!this.multiple){ | |||
| this.selected = v ? v : '' | |||
| }else{ | |||
| if(v){ | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let arr = v.split(',') | |||
| let s = [] | |||
| _.forEach(arr,a=>{ | |||
| s.push(a) | |||
| }) | |||
| this.selected = s | |||
| }else{ | |||
| this.selected = [] | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selected: '', | |||
| list: [], | |||
| queryParams: { | |||
| pageNum: 1, | |||
| pageSize: 9999, | |||
| dictType: 'system_business_ccwz', | |||
| status: 0 | |||
| }, | |||
| }; | |||
| }, | |||
| mounted() { | |||
| this.getList() | |||
| }, | |||
| methods: { | |||
| getList() { | |||
| this.list = [] | |||
| listData(this.queryParams).then(response => { | |||
| this.list = response.rows | |||
| }) | |||
| }, | |||
| handleChange(val) { | |||
| this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || '')) | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let _index = _.findIndex(this.list, function (a) { | |||
| return a.dictLabel == val | |||
| }) | |||
| console.log(_index) | |||
| if (_index > -1) { | |||
| this.$emit('change', this.list[_index]) | |||
| } else { | |||
| this.$emit('change', null) | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| @ -0,0 +1,98 @@ | |||
| <!-- 浓度单位选择器 --> | |||
| <template> | |||
| <div> | |||
| <el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable"> | |||
| <el-option v-for="item in list" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel" /> | |||
| </el-select> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import { listData } from "@/api/system/dict/data" | |||
| export default { | |||
| name: "SelectNddw", | |||
| components: {}, | |||
| props: { | |||
| value: { | |||
| type: [Number, String , Array], | |||
| default: '', | |||
| }, | |||
| readonly: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| multiple: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| filterable: { | |||
| type: Boolean, | |||
| default: true | |||
| }, | |||
| placeholder: { | |||
| type: String, | |||
| default: '' | |||
| } | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| if(!this.multiple){ | |||
| this.selected = v ? v : '' | |||
| }else{ | |||
| if(v){ | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let arr = v.split(',') | |||
| let s = [] | |||
| _.forEach(arr,a=>{ | |||
| s.push(a) | |||
| }) | |||
| this.selected = s | |||
| }else{ | |||
| this.selected = [] | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selected: '', | |||
| list: [], | |||
| queryParams: { | |||
| pageNum: 1, | |||
| pageSize: 9999, | |||
| dictType: 'system_business_nddw', | |||
| status: 0 | |||
| }, | |||
| }; | |||
| }, | |||
| mounted() { | |||
| this.getList() | |||
| }, | |||
| methods: { | |||
| getList() { | |||
| this.list = [] | |||
| listData(this.queryParams).then(response => { | |||
| this.list = response.rows | |||
| }) | |||
| }, | |||
| handleChange(val) { | |||
| this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || '')) | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let _index = _.findIndex(this.list, function (a) { | |||
| return a.dictLabel == val | |||
| }) | |||
| console.log(_index) | |||
| if (_index > -1) { | |||
| this.$emit('change', this.list[_index]) | |||
| } else { | |||
| this.$emit('change', null) | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| @ -0,0 +1,98 @@ | |||
| <!-- 体积单位选择器 --> | |||
| <template> | |||
| <div> | |||
| <el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable"> | |||
| <el-option v-for="item in list" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel" /> | |||
| </el-select> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import { listData } from "@/api/system/dict/data" | |||
| export default { | |||
| name: "SelectTjdw", | |||
| components: {}, | |||
| props: { | |||
| value: { | |||
| type: [Number, String , Array], | |||
| default: '', | |||
| }, | |||
| readonly: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| multiple: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| filterable: { | |||
| type: Boolean, | |||
| default: true | |||
| }, | |||
| placeholder: { | |||
| type: String, | |||
| default: '' | |||
| } | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| if(!this.multiple){ | |||
| this.selected = v ? v : '' | |||
| }else{ | |||
| if(v){ | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let arr = v.split(',') | |||
| let s = [] | |||
| _.forEach(arr,a=>{ | |||
| s.push(a) | |||
| }) | |||
| this.selected = s | |||
| }else{ | |||
| this.selected = [] | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selected: '', | |||
| list: [], | |||
| queryParams: { | |||
| pageNum: 1, | |||
| pageSize: 9999, | |||
| dictType: 'system_business_tjdw', | |||
| status: 0 | |||
| }, | |||
| }; | |||
| }, | |||
| mounted() { | |||
| this.getList() | |||
| }, | |||
| methods: { | |||
| getList() { | |||
| this.list = [] | |||
| listData(this.queryParams).then(response => { | |||
| this.list = response.rows | |||
| }) | |||
| }, | |||
| handleChange(val) { | |||
| this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || '')) | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let _index = _.findIndex(this.list, function (a) { | |||
| return a.dictLabel == val | |||
| }) | |||
| console.log(_index) | |||
| if (_index > -1) { | |||
| this.$emit('change', this.list[_index]) | |||
| } else { | |||
| this.$emit('change', null) | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| @ -0,0 +1,98 @@ | |||
| <!-- 有效期单位选择器 --> | |||
| <template> | |||
| <div> | |||
| <el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable"> | |||
| <el-option v-for="item in list" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel" /> | |||
| </el-select> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import { listData } from "@/api/system/dict/data" | |||
| export default { | |||
| name: "SelectYxqdw", | |||
| components: {}, | |||
| props: { | |||
| value: { | |||
| type: [Number, String , Array], | |||
| default: '', | |||
| }, | |||
| readonly: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| multiple: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| filterable: { | |||
| type: Boolean, | |||
| default: true | |||
| }, | |||
| placeholder: { | |||
| type: String, | |||
| default: '' | |||
| } | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| if(!this.multiple){ | |||
| this.selected = v ? v : '' | |||
| }else{ | |||
| if(v){ | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let arr = v.split(',') | |||
| let s = [] | |||
| _.forEach(arr,a=>{ | |||
| s.push(a) | |||
| }) | |||
| this.selected = s | |||
| }else{ | |||
| this.selected = [] | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selected: '', | |||
| list: [], | |||
| queryParams: { | |||
| pageNum: 1, | |||
| pageSize: 9999, | |||
| dictType: 'system_business_yxqdw', | |||
| status: 0 | |||
| }, | |||
| }; | |||
| }, | |||
| mounted() { | |||
| this.getList() | |||
| }, | |||
| methods: { | |||
| getList() { | |||
| this.list = [] | |||
| listData(this.queryParams).then(response => { | |||
| this.list = response.rows | |||
| }) | |||
| }, | |||
| handleChange(val) { | |||
| this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || '')) | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let _index = _.findIndex(this.list, function (a) { | |||
| return a.dictLabel == val | |||
| }) | |||
| console.log(_index) | |||
| if (_index > -1) { | |||
| this.$emit('change', this.list[_index]) | |||
| } else { | |||
| this.$emit('change', null) | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| @ -0,0 +1,98 @@ | |||
| <!-- 质量单位选择器 --> | |||
| <template> | |||
| <div> | |||
| <el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable"> | |||
| <el-option v-for="item in list" :key="item.dictCode" :label="item.dictLabel" :value="item.dictLabel" /> | |||
| </el-select> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import { listData } from "@/api/system/dict/data" | |||
| export default { | |||
| name: "SelectZldw", | |||
| components: {}, | |||
| props: { | |||
| value: { | |||
| type: [Number, String , Array], | |||
| default: '', | |||
| }, | |||
| readonly: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| multiple: { | |||
| type: Boolean, | |||
| default: false | |||
| }, | |||
| filterable: { | |||
| type: Boolean, | |||
| default: true | |||
| }, | |||
| placeholder: { | |||
| type: String, | |||
| default: '' | |||
| } | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| if(!this.multiple){ | |||
| this.selected = v ? v : '' | |||
| }else{ | |||
| if(v){ | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let arr = v.split(',') | |||
| let s = [] | |||
| _.forEach(arr,a=>{ | |||
| s.push(a) | |||
| }) | |||
| this.selected = s | |||
| }else{ | |||
| this.selected = [] | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selected: '', | |||
| list: [], | |||
| queryParams: { | |||
| pageNum: 1, | |||
| pageSize: 9999, | |||
| dictType: 'system_business_zldw', | |||
| status: 0 | |||
| }, | |||
| }; | |||
| }, | |||
| mounted() { | |||
| this.getList() | |||
| }, | |||
| methods: { | |||
| getList() { | |||
| this.list = [] | |||
| listData(this.queryParams).then(response => { | |||
| this.list = response.rows | |||
| }) | |||
| }, | |||
| handleChange(val) { | |||
| this.$emit('input', this.multiple ? (val && val.length>0 ? val.join(','): ''):(val || '')) | |||
| //默认传的,分割的字符串,有传数组再改造 | |||
| let _index = _.findIndex(this.list, function (a) { | |||
| return a.dictLabel == val | |||
| }) | |||
| console.log(_index) | |||
| if (_index > -1) { | |||
| this.$emit('change', this.list[_index]) | |||
| } else { | |||
| this.$emit('change', null) | |||
| } | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||