|  |  |  | 
|---|
|  |  |  | <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-option v-for="op in StoreTypeOps" :key="op.id" :label="op.name" :value="op.id"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item class="w3" label="处理人" prop="name"> | 
|---|
|  |  |  | <el-input v-model="param.createUserName" :disabled="true" v-trim /> | 
|---|
|  |  |  | <el-form-item class="w3" label="领用人" prop="outUserId"> | 
|---|
|  |  |  | <el-select v-model="param.outUserId" filterable placeholder="请选择"> | 
|---|
|  |  |  | <el-option v-for="item in userList" :key="item.id" :label="item.realname" :value="item.id"> | 
|---|
|  |  |  | </el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item class="w6" label="备注" prop="remark"> | 
|---|
|  |  |  | <el-input v-model="param.remark" placeholder="请输入" v-trim /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item class="w3" label="处理人" prop="name"> | 
|---|
|  |  |  | <el-input v-model="param.createUserName" :disabled="true" v-trim /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | <!--  --> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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(/[^\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> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <el-table-column prop="maxStock" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | import AssetSel from './AssetSel' | 
|---|
|  |  |  | import { fetchList as getStoreList } from '@/api/ywWarehouse' | 
|---|
|  |  |  | import { ywOutinboundCreate } from '@/api/store/index' | 
|---|
|  |  |  | import { getUserList } from '@/api/system/user' | 
|---|
|  |  |  | import { StoreTypeOps, rules } from './config' | 
|---|
|  |  |  | import { Message } from 'element-ui' | 
|---|
|  |  |  | import dayjs from 'dayjs' | 
|---|
|  |  |  | 
|---|
|  |  |  | rules, | 
|---|
|  |  |  | storeList: [], | 
|---|
|  |  |  | list: [], | 
|---|
|  |  |  | StoreTypeOps: StoreTypeOps.filter(i => i.type == 1), | 
|---|
|  |  |  | userList: [], | 
|---|
|  |  |  | StoreTypeOps: StoreTypeOps.filter(i => i.type == 1 && i.id != 10), | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dataList: [], | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$refs['form'].validate((valid) => { | 
|---|
|  |  |  | if (valid) { | 
|---|
|  |  |  | const { param, list } = this | 
|---|
|  |  |  | if(list.length == 0) return Message.warning('请先选择物料信息') | 
|---|
|  |  |  | if (list.length == 0) return Message.warning('请先选择物料信息') | 
|---|
|  |  |  | let count = 0 // 出库数量必填 | 
|---|
|  |  |  | list.forEach(item => { | 
|---|
|  |  |  | if(!item.stock) count ++ | 
|---|
|  |  |  | if (!item.stock) count++ | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if(count > 0) return Message.warning('请输入正确的出库数量') | 
|---|
|  |  |  | if (count > 0) return Message.warning('请输入正确的出库数量') | 
|---|
|  |  |  | this.isLoading = true | 
|---|
|  |  |  | ywOutinboundCreate({ | 
|---|
|  |  |  | ...param, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getUser() { | 
|---|
|  |  |  | getUserList({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.userList = res | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeStore() { | 
|---|
|  |  |  | this.list = [] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | initData() { | 
|---|
|  |  |  | this.$set(this.param, 'doneDate', dayjs().format('YYYY-MM-DD')) | 
|---|
|  |  |  | getStoreList({ capacity: 9999, page: 1, model: {status: 0} }).then(res => { | 
|---|
|  |  |  | getStoreList({ capacity: 9999, page: 1, model: { status: 0 } }).then(res => { | 
|---|
|  |  |  | this.storeList = res.records || [] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.getUser() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeSel(val) { | 
|---|
|  |  |  | const list = val | 
|---|
|  |  |  | list.forEach(item => { | 
|---|
|  |  |  | if(this.list.indexOf(item.id) === -1){ | 
|---|
|  |  |  | if (this.list.indexOf(item.id) === -1) { | 
|---|
|  |  |  | item.materialId = item.id | 
|---|
|  |  |  | item.stock = null | 
|---|
|  |  |  | item.createDate = null | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 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('-----'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log('-----') | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | close() { | 
|---|