|
@@ -8,16 +8,7 @@
|
|
|
<div class="tag">库位信息</div>
|
|
|
</div>
|
|
|
<div class="actions">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- v-hasPermi="['system:dataPermissions:addRole']"
|
|
|
- style="margin-right: 10px"
|
|
|
- @click="addStockShow"
|
|
|
- v-if="hasDeptIds.length"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['system:dataPermissions:addRole']" style="margin-right: 10px" @click="addStockShow" v-if="hasDeptIds.length">添加</el-button>
|
|
|
<right-toolbar @queryTable="getList" :isShowSearch="false"></right-toolbar>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -29,8 +20,8 @@
|
|
|
<el-table-column label="描述" prop="remark" />
|
|
|
<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)" v-hasPermi="[' system:dataPermissions:updRole']">保管员</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)" v-hasPermi="[' system:dataPermissions:updRole']">修改</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">保管员</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">修改</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="delStock(scope.row)" v-hasPermi="['system:dataPermissions:delRole']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -53,7 +44,7 @@
|
|
|
<el-button type="primary" size="small" @click="stockSub">保 存</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <UserChoice ref="userChoice" @selectedPerson="selectedPerson"/>
|
|
|
+ <UserChoice ref="userChoice" @selectedPerson="selectedPerson" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -87,7 +78,7 @@ export default {
|
|
|
stockForm: { deptId: '', locationName: '', remark: '', deptName: '' },
|
|
|
//库位表单验证
|
|
|
stockRules: { locationName: [{ required: true, message: '名称不能为空', trigger: 'blur' }] },
|
|
|
- locationId: '', // 库位id
|
|
|
+ locationId: '' // 库位id
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -98,7 +89,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
- stockList({ deptIds: this.hasDeptIds }).then((res) => {
|
|
|
+ stockList({ deptIds: this.hasDeptIds }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.dataList = res.data
|
|
|
this.loading = false
|
|
@@ -121,7 +112,7 @@ export default {
|
|
|
},
|
|
|
//检测重名
|
|
|
checkName(data) {
|
|
|
- let o = this.dataList.find((item) => item.locationName == data.locationName && item.locationId != data.locationId)
|
|
|
+ let o = this.dataList.find(item => item.locationName == data.locationName && item.locationId != data.locationId)
|
|
|
if (o) {
|
|
|
return '库位名称重复'
|
|
|
}
|
|
@@ -134,7 +125,7 @@ export default {
|
|
|
},
|
|
|
//库位弹窗提交
|
|
|
stockSub() {
|
|
|
- this.$refs.stockForm.validate((valid) => {
|
|
|
+ this.$refs.stockForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
let checkFiled = this.checkName(this.stockForm)
|
|
|
if (checkFiled) {
|
|
@@ -142,10 +133,10 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
if (this.stockForm.locationId) {
|
|
|
- stockUpd(this.stockForm).then((res) => {
|
|
|
+ stockUpd(this.stockForm).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$msg({ message: '修改成功' })
|
|
|
- this.dataList = this.dataList.map((item) => {
|
|
|
+ this.dataList = this.dataList.map(item => {
|
|
|
if (item.locationId == this.stockForm.locationId) {
|
|
|
return {
|
|
|
...item,
|
|
@@ -160,7 +151,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- stockAdd(this.stockForm).then((res) => {
|
|
|
+ stockAdd(this.stockForm).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$msg({ message: '添加成功' })
|
|
|
this.getList()
|
|
@@ -174,15 +165,15 @@ export default {
|
|
|
//选择人员
|
|
|
choiceUser(row) {
|
|
|
this.locationId = row.locationId
|
|
|
- treeselect().then((response) => {
|
|
|
+ treeselect().then(response => {
|
|
|
this.deptOptions = response.data
|
|
|
- this.deptOptions.unshift({id: '0', label: '全部部门'})
|
|
|
+ this.deptOptions.unshift({ id: '0', label: '全部部门' })
|
|
|
this.$refs.userChoice.init(true, this.deptOptions)
|
|
|
})
|
|
|
},
|
|
|
//人员回调
|
|
|
selectedPerson(data) {
|
|
|
- updateKeeper({keeper: data, locationId: this.locationId}).then(res => {
|
|
|
+ updateKeeper({ keeper: data, locationId: this.locationId }).then(res => {
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
@@ -203,10 +194,10 @@ export default {
|
|
|
this.$modal
|
|
|
.confirm('确定要删除吗')
|
|
|
.then(() => {
|
|
|
- stockDel(row.locationId).then((res) => {
|
|
|
+ stockDel(row.locationId).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$msg({ message: '删除成功' })
|
|
|
- this.dataList = this.dataList.filter((item) => item.locationId != row.locationId)
|
|
|
+ this.dataList = this.dataList.filter(item => item.locationId != row.locationId)
|
|
|
} else {
|
|
|
this.$msg({ type: 'error', message: res.msg })
|
|
|
}
|