|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <GlobalWindow title="新建出库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close" | 
|---|
|  |  |  | <GlobalWindow title="新建出库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="1000px" @close="close" | 
|---|
|  |  |  | @confirm="confirm"> | 
|---|
|  |  |  | <el-form :model="param" ref="form" :rules="rules"> | 
|---|
|  |  |  | <div class="df_ac"> | 
|---|
|  |  |  | <el-form-item class="w3" label="出库仓库" prop="warehouseId"> | 
|---|
|  |  |  | <el-select :disabled="param.id" v-model="param.warehouseId" placeholder="请选择"> | 
|---|
|  |  |  | <el-select :disabled="param.id" @change="changeStore" v-model="param.warehouseId" placeholder="请选择"> | 
|---|
|  |  |  | <el-option v-for="op in storeList" :key="op.id" :label="op.name" :value="op.id"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-table-column prop="unitName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="dealUserName" label="出库数量" min-width="90px"> | 
|---|
|  |  |  | <template v-slot="{ row }"> | 
|---|
|  |  |  | <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.stock" | 
|---|
|  |  |  | <el-input oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" v-model="row.stock" | 
|---|
|  |  |  | class="w100"></el-input> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { ywOutinboundCreate } from '@/api/store/index' | 
|---|
|  |  |  | import { StoreTypeOps, rules } from './config' | 
|---|
|  |  |  | import { Message } from 'element-ui' | 
|---|
|  |  |  | import dayjs from 'dayjs' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'OperaCategoryWindow', | 
|---|
|  |  |  | components: { GlobalWindow, AssetSel }, | 
|---|
|  |  |  | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // 表单数据 | 
|---|
|  |  |  | param: { | 
|---|
|  |  |  | createUserName: this.$store.state.userInfo.username, | 
|---|
|  |  |  | createUserName: this.$store.state.userInfo.realname || this.$store.state.userInfo.username, | 
|---|
|  |  |  | creator: this.$store.state.userInfo.id, | 
|---|
|  |  |  | inOut: 1 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeStore() { | 
|---|
|  |  |  | this.list = [] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | initData() { | 
|---|
|  |  |  | getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => { | 
|---|
|  |  |  | this.$set(this.param, 'doneDate', dayjs().format('YYYY-MM-DD')) | 
|---|
|  |  |  | getStoreList({ capacity: 9999, page: 1, model: {status: 0} }).then(res => { | 
|---|
|  |  |  | this.storeList = res.records || [] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | if(this.list.indexOf(item.id) === -1){ | 
|---|
|  |  |  | item.materialId = item.id | 
|---|
|  |  |  | item.stock = null | 
|---|
|  |  |  | item.createDate = null | 
|---|
|  |  |  | this.list.push(item) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleOpenMaterial() { | 
|---|
|  |  |  | if(!this.param.warehouseId) return Message.warning('请先选择出库仓库') | 
|---|
|  |  |  | this.isShowSel = true | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.AssetSelRef.isShowModal = true | 
|---|
|  |  |  | this.$refs.AssetSelRef.isOut = true | 
|---|
|  |  |  | this.$refs.AssetSelRef.warehouseId = this.param.warehouseId | 
|---|
|  |  |  | this.$refs.AssetSelRef.getList() | 
|---|
|  |  |  | console.log('-----'); | 
|---|
|  |  |  |  | 
|---|