| | |
| | | this.$bus.$off('getCurrSelected', this.handleGetCurrSelected); |
| | | }, |
| | | methods: { |
| | | handleAdd: function () { |
| | | const nextSeq = Number(this.dataSource[this.dataSource.length - 1].seq) + 1 |
| | | this.$refs.modalForm.add(nextSeq); |
| | | this.$refs.modalForm.title = "新增"; |
| | | this.$refs.modalForm.disableSubmit = false; |
| | | }, |
| | | handleStatus(record) { |
| | | getAction(this.url.list, { parentId: record.id }).then((res) => { |
| | | if (res.success) { |
| | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="库位号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" :value="locationCode" placeholder="请输入库位号" ></a-input> |
| | | <a-input v-model="model.locationCode" placeholder="请输入库位号" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | locationCode: '', |
| | | remark: '' |
| | | }, |
| | | autoLocationCode: '', // 自动拼接的库位号 |
| | | userEditedLocationCode: false, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | |
| | | return this.disabled |
| | | }, |
| | | //拼接库位号 |
| | | locationCode() { |
| | | autoGeneratedLocationCode() { |
| | | const { shelfNumber, storey, arrange, columnNumber } = this.model; |
| | | if (shelfNumber || storey || arrange || columnNumber) { |
| | | return `${shelfNumber}${storey}${arrange}${columnNumber}`; |
| | |
| | | }, |
| | | }, |
| | | watch: { |
| | | 'model.shelfNumber': 'updateLocationCode', |
| | | 'model.storey': 'updateLocationCode', |
| | | 'model.arrange': 'updateLocationCode', |
| | | 'model.columnNumber': 'updateLocationCode' |
| | | autoGeneratedLocationCode(newVal) { |
| | | // 只有当用户没有手动输入时才自动填充 |
| | | if (!this.userEditedLocationCode) { |
| | | this.model.locationCode = newVal; |
| | | } |
| | | this.autoLocationCode = newVal; |
| | | }, |
| | | 'model.locationCode'(newVal) { |
| | | // 如果用户手动输入,则标记为已编辑 |
| | | if (newVal !== this.autoLocationCode) { |
| | | this.userEditedLocationCode = true; |
| | | } else { |
| | | this.userEditedLocationCode = false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="叶子节点标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leafFlag"> |
| | | <a-radio-group :disabled="leafDisableFlag" v-model="model.leafFlag" placeholder="请选择是否叶子节点"> |
| | | <a-radio-group :default-value="'2'" :disabled="leafDisableFlag" v-model="model.leafFlag" placeholder="请选择是否叶子节点"> |
| | | <a-radio :value="'2'">有子节点</a-radio> |
| | | <a-radio :value="'1'">是叶子节点</a-radio> |
| | | </a-radio-group> |
| | |
| | | console.error(e); |
| | | } |
| | | }, |
| | | add (treeSelected) { |
| | | add (treeSelected, nextSeq) { |
| | | this.modelDefault.parentId = treeSelected.key |
| | | this.modelDefault.parentWarehouseId = treeSelected.entity.warehouseId |
| | | this.modelDefault.parentWarehouseName = treeSelected.entity.warehouseName |
| | | this.modelDefault.seq = nextSeq |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | add () { |
| | | add (nextSeq) { |
| | | this.visible=true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.realForm.add(this.treeSelected); |
| | | this.$refs.realForm.add(this.treeSelected, nextSeq); |
| | | }) |
| | | }, |
| | | edit (record) { |