| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="父节点类型" prop="pType"> |
| | | <el-input |
| | | v-model="dataForm.pType" |
| | | placeholder="父节点类型" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="创建时间" prop="createTime"> |
| | | <el-date-picker |
| | | readonly |
| | | style="width: 100%" |
| | | v-model="moment" |
| | | type="datetime" |
| | | placeholder="选择日期时间" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item |
| | | v-if="permissions.basic_has_ifs" |
| | | label="IFS库位" |
| | | prop="ifsLocationDesc" |
| | | > |
| | | <!--<el-select |
| | | > --> |
| | | <!-- <el-select |
| | | v-model="dataForm.ifsLocation" |
| | | filterable |
| | | placeholder="请选择IFS库位" |
| | |
| | | :key="index" |
| | | > |
| | | </el-option> |
| | | </el-select>--> |
| | | <el-cascader |
| | | </el-select> --> |
| | | <!-- <el-cascader |
| | | v-model="dataForm.ifsLocationDesc" |
| | | :props="locationProps" |
| | | style="width:100%" |
| | | style="width:100%" filterable |
| | | ></el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="库位状态" prop="locStatus"> |
| | | <el-switch |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="创建时间" prop="createTime"> |
| | | <el-date-picker |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="visible = false">取消</el-button> |
| | |
| | | warehouseOptions: [], |
| | | factoryOptions: [], |
| | | ifsLocationOptions: [], |
| | | locationTree: [], |
| | | visible: false, |
| | | dataForm: { |
| | | id: 0, |
| | |
| | | locationProps: { |
| | | lazy: true, |
| | | lazyLoad(node, resolve) { |
| | | console.log('node', node) |
| | | const { level } = node |
| | | if (level === 0) { |
| | | getIfsLocationGroup().then((response) => { |
| | | if (response.data.code === 0) { |
| | | const _data = response.data.data |
| | | |
| | | const nodes = _data.map((item) => { |
| | | const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => { |
| | | return { |
| | | value: item.LOCATION_GROUP, |
| | | label: item.LOCATION_GROUP, |
| | | value: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP, |
| | | label: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP, |
| | | leaf: false |
| | | } |
| | | }) |
| | | var set = new Set() |
| | | nodes.forEach(a=>{ |
| | | set.add(JSON.stringify(a)) |
| | | }) |
| | | var list = [] |
| | | set.forEach(a=>{ |
| | | list.push(JSON.parse(a)) |
| | | }) |
| | | // 通过调用resolve将子节点数据返回,通知组件数据加载完成 |
| | | resolve(nodes) |
| | | resolve(list) |
| | | } |
| | | }) |
| | | } else { |
| | | getIfsLocationByGroup({ locationGroup: node.value }).then( |
| | | getIfsLocationByGroup({ locationNo: node.value.split('-')[1] }).then( |
| | | (response) => { |
| | | if (response.data.code === 0) { |
| | | const _data = response.data.data |
| | | |
| | | const nodes = _data.map((item) => { |
| | | const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => { |
| | | return { |
| | | value: item.LOCATION_NO, |
| | | label: item.LOCATION_NO, |
| | | label: item.LOCATION_DESC +' | '+ item.LOCATION_NO, |
| | | leaf: true |
| | | } |
| | | }) |
| | |
| | | this.visible = false |
| | | this.isSubmit = false |
| | | this.$emit('refreshDataList') |
| | | }).catch(error=>{ |
| | | console.error(error); |
| | | this.isSubmit = false |
| | | }) |
| | | } else { |
| | | addObj(this.dataForm).then((data) => { |
| | |
| | | this.visible = false |
| | | this.isSubmit = false |
| | | this.$emit('refreshDataList') |
| | | }).catch(error=>{ |
| | | console.error(error); |
| | | this.isSubmit = false |
| | | }) |
| | | } |
| | | } else { |
| | | this.isSubmit = false |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | getLocationTree(){ |
| | | getIfsLocationGroup().then((res) => { |
| | | if (res.data.code === 0) { |
| | | var strs = JSON.parse(res.data.data)['LIST_INFO'] |
| | | var set3 = new Set() |
| | | var set2 = new Set() |
| | | var set = [] |
| | | strs.forEach(a=>{ |
| | | set2.add(a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP']) |
| | | }) |
| | | strs.forEach(a=>{ |
| | | set2.forEach(b=>{ |
| | | if((a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP'])==b){ |
| | | set3.add(a['LOCATION_DESC'] + '-' + a['LOCATION_NO']) |
| | | } |
| | | set.push({ |
| | | value: b, |
| | | label: b, |
| | | children: [] |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |