Commit 3a62844c by wangyalan-git

出库管理修改删除

parent f6d1c558
......@@ -141,11 +141,15 @@
</el-pagination>
</div>
</el-card>
<!-- 弹窗 -->
<update-num-modal ref="updateNum"
@ok="getList"></update-num-modal>
</div>
</template>
<script>
import moment from 'moment'
import { getOutboundRecordList, getGoodsCategoryList, getStockRooms, getDepartmentList,updateOutboundRecord } from '@/api/inventory'
import UpdateNumModal from './modules/UpdateNumModal'
// 列表查询参数默认值
const defaultListQuery = {
pageNum: 1,
......@@ -161,7 +165,7 @@ const defaultListQuery = {
export default {
name: 'WarehouseAdmin',
components: {},
components: {UpdateNumModal},
data() {
return {
dateRange: [],
......@@ -192,10 +196,18 @@ export default {
methods: {
// 选择时间
changeDate(value){
this.listQuery.startTime = value[0]
this.listQuery.endTime = value[1]
if(value){
this.listQuery.startTime = value[0]
this.listQuery.endTime = value[1]
}else {
this.listQuery.startTime =null
this.listQuery.endTime = null
}
console.log('value',value)
},
handleResetSearch() {
this.dateRange = null
this.listQuery = Object.assign({}, defaultListQuery)
this.getList()
},
......@@ -250,7 +262,7 @@ export default {
},
// 修改/
handleUpdate(row){
this.$refs.detail.update(row)
this.$refs.updateNum.update(row)
},
// 删除
handleDelete(row){
......
<template>
<el-dialog :visible.sync="visible"
:title="title"
center
width="500px">
<!-- start -->
<el-form :model="model"
ref="attributeForm"
v-loading="loading"
label-width="150px">
<el-form-item label="物品名称:">
<span>{{model.goodsName}}</span>
</el-form-item>
<el-form-item label="型号:">
<span>{{model.goodsNo}}</span>
</el-form-item>
<el-form-item label="物品类别:">
<span>{{model.categoryName}}</span>
</el-form-item>
<el-form-item label="出库数量:"
:rules="[{required: true, trigger: 'blur', message: '请输入出库数量'}]"
prop="outboundNum">
<el-input size="small"
class="input-width"
placeholder="请输入出库数量"
v-model="model.outboundNum"></el-input>
</el-form-item>
<el-form-item label="申领人:">
<span>{{$store.getters.type == 1? this.model.backOutboundName : this.model.receptOutboundName}}</span>
</el-form-item>
<el-form-item label="所属部门:">
<span>{{model.departmentName}}</span>
</el-form-item>
<el-form-item label="所属库房:">
<span>{{model.stockRoomName}}</span>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary"
@click="submit">确认</el-button>
<el-button @click="close">取消</el-button>
</div>
<!-- end -->
</el-dialog>
</template>
<script>
import { updateOutboundRecord } from '@/api/inventory'
// 移动属性
export default {
name: 'UpdateNumModal',
data () {
return {
visible: false,
title: null,
loading: false,
id: null,
model: {}
}
},
methods: {
init () {
this.$nextTick(() => {
this.$refs.attributeForm.clearValidate()
})
},
update(row){
this.id = null
this.title="修改出库数量"
this.init()
this.model = row
this.visible= true
},
// 提交保存
submit () {
this.$refs.attributeForm.validate((valid) => {
if (valid) {
// 验证通过
updateOutboundRecord({id: this.model.id,outboundNum: this.model.outboundNum}).then(res => {
this.loading = false
this.visible = false
this.$emit('ok')
}).catch(err => {
this.loading = false
})
}
})
},
close () {
this.$emit('close')
this.visible = false
}
}
}
</script>
<style scoped>
.input-width {
width: 200px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment