Commit 9fd7a8fe authored by kzy's avatar kzy

设备库中的开始盘点和结束盘点成功

parent 0949ba1a
...@@ -20,3 +20,28 @@ export function abandon(data) { ...@@ -20,3 +20,28 @@ export function abandon(data) {
} }
}) })
} }
export function checkType(data){
return request({
url: '/wbwarehouseinventorytemp/checkType/' + data,
method:'get'
})
}
export function addList(data){
return request({
url: '/wbwarehouseinventorytemp/addList',
method:'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function deleteByType(data){
return request({
url: '/wbwarehouseinventorytemp/deleteByType/' + data,
method:'delete'
})
}
\ No newline at end of file
...@@ -38,19 +38,13 @@ ...@@ -38,19 +38,13 @@
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
<el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="handleAdd">开始盘点 {{ check }} </el-button> <el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="checkType">开始盘点 {{ check }} </el-button>
</el-form-item> </el-form-item>
<!-- 这俩都没写接口以及方法 -->
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
...@@ -229,7 +223,7 @@ import { ...@@ -229,7 +223,7 @@ import {
getRole, getRole,
updateRole updateRole
} from '@/api/system/role' } from '@/api/system/role'
import { listCheck} from '@/api/equipment/check' import { checkType, listCheck,addList,deleteByType} from '@/api/equipment/check'
import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu' import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu'
import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept' import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template' // import { getRolesByInsId } from '../../../api/businessManage/template'
...@@ -237,6 +231,13 @@ export default { ...@@ -237,6 +231,13 @@ export default {
name: 'Role', name: 'Role',
data() { data() {
return { return {
// 需要盘点的list
checkFrom: {
Ptype: '',
checkList: [],
},
// 选中的列表
selectList:[],
// TODO: 表单里的单项详情参数 // TODO: 表单里的单项详情参数
singleDetails: { singleDetails: {
equipmentName: '', equipmentName: '',
...@@ -400,6 +401,37 @@ export default { ...@@ -400,6 +401,37 @@ export default {
this.title = '详情信息' this.title = '详情信息'
this.openDetails = !this.openDetails this.openDetails = !this.openDetails
}, },
deleteByType(){
deleteByType(1).then(flag => {
if(flag.data > 0){
this.$message.success("结束盘点成功")
}else{
this.$message.error("结束盘点失败")
}
})
},
checkType(){
checkType(1).then(total => {
if(total.data !== 0){
this.$message.error("请先结束盘点")
}else{
let data = []
if(this.selectList.length === 0){
data = this.equipmentList
}else{
data = this.selectList
}
addList(data).then(flag => {
if(flag.data.influence > 0){
this.$message.success("盘点成功")
}else{
this.$message.error("盘点失败")
}
})
}
})
},
handelTab(i, e) { handelTab(i, e) {
const that = this const that = this
if (!that.$refs['input' + i]) { if (!that.$refs['input' + i]) {
...@@ -565,6 +597,7 @@ export default { ...@@ -565,6 +597,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId) this.ids = selection.map(item => item.roleId)
this.selectList = selection
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
......
...@@ -38,24 +38,11 @@ ...@@ -38,24 +38,11 @@
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" :type="typePrimary" :size="smallSize" :icon="addIcon" @click="checkType">开始盘点 {{ check }} </el-button>
style="padding: 8px 7px;"
:type="typePrimary"
:size="smallSize"
:icon="addIcon"
>开始盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -236,7 +223,8 @@ import { ...@@ -236,7 +223,8 @@ import {
listRole, listRole,
updateRole updateRole
} from '@/api/system/role' } from '@/api/system/role'
import {listCheck} from '@/api/equipment/check' import {listCheck } from '@/api/equipment/checkProcess'
import { checkType, addList,deleteByType} from '@/api/equipment/check'
import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu' import {roleMenuTreeselect, roleMenuTreeselectMC, treeselect as menuTreeselect} from '@/api/system/menu'
import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept' import {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template' // import { getRolesByInsId } from '../../../api/businessManage/template'
...@@ -403,6 +391,36 @@ export default { ...@@ -403,6 +391,36 @@ export default {
this.title = '详情信息' this.title = '详情信息'
this.openDetails = !this.openDetails this.openDetails = !this.openDetails
}, },
deleteByType(){
deleteByType(2).then(flag => {
if(flag.data > 0){
this.$message.success("结束盘点成功")
}else{
this.$message.error("结束盘点失败")
}
})
},
checkType(){
checkType(2).then(total => {
if(total.data !== 0){
this.$message.error("请先结束盘点")
}else{
let data = []
if(this.selectList.length === 0){
data = this.equipmentList
}else{
data = this.selectList
}
addList(data).then(flag => {
if(flag.data.influence > 0){
this.$message.success("盘点成功")
}else{
this.$message.error("盘点失败")
}
})
}
})
},
handelTab(i, e) { handelTab(i, e) {
const that = this const that = this
if (!that.$refs['input' + i]) { if (!that.$refs['input' + i]) {
......
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