Commit ac88afdf authored by AiNoeLiYa's avatar AiNoeLiYa

Merge branch 'project1' of http://gitlab.91isoft.com:90/yangshuo/template_vue into project1

parents 0482dd8c f307658c
......@@ -39,33 +39,11 @@ export function updataInfo(data) {
})
}
// 角色状态修改
export function changeRoleStatus(businessId, flag) {
const data = {
businessId,
flag
}
return request({
url: '/system/role/changeStatus',
method: 'put',
params: data
})
}
// 删除角色
export function delRole(roleId) {
// 逻辑删除基础信息接口
export function deleteLogical(id) {
return request({
url: '/system/role/deleteLogical/' + roleId,
url: '/wbbaseinfo/deleteLogical/' + id,
method: 'delete'
})
}
// 导出角色
export function exportRole(query) {
return request({
url: '/system/role/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -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
......@@ -92,9 +92,9 @@
{{ scope.row.createName || '-' }}
</template>
</el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px">
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
<span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
......@@ -170,7 +170,7 @@
</template>
<script>
import { add, listBasicInfo, updataInfo, getDetailById } from '@/api/equipment/basicInfo'
import { add, listBasicInfo, updataInfo, getDetailById, deleteLogical } from '@/api/equipment/basicInfo'
import { parseTime } from '@/utils'
export default {
name: 'Role',
......@@ -475,25 +475,24 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.businessId || this.ids
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delRole(roleIds)
}).then(() => {
}).then(res => {
deleteLogical(id).then(res => {
if (res.code === 200) {
this.$message.success('操作成功')
this.getList()
this.$message({
message: '删除成功',
type: 'success'
}
})
}).catch(function() {
})
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
......
......@@ -38,19 +38,13 @@
</el-form-item>
<div style="float: right">
<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-button
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
<el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
......@@ -229,7 +223,7 @@ import {
getRole,
updateRole
} 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 {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template'
......@@ -237,6 +231,13 @@ export default {
name: 'Role',
data() {
return {
// 需要盘点的list
checkFrom: {
Ptype: '',
checkList: [],
},
// 选中的列表
selectList:[],
// TODO: 表单里的单项详情参数
singleDetails: {
equipmentName: '',
......@@ -400,6 +401,37 @@ export default {
this.title = '详情信息'
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) {
const that = this
if (!that.$refs['input' + i]) {
......@@ -565,6 +597,7 @@ export default {
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.selectList = selection
this.single = selection.length !== 1
this.multiple = !selection.length
},
......
......@@ -38,24 +38,11 @@
</el-form-item>
<div style="float: right">
<el-form-item>
<el-button
style="padding: 8px 7px;"
:type="typePrimary"
:size="smallSize"
:icon="addIcon"
>开始盘点
{{ 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-button
style="padding: 8px 7px;"
type="danger"
:size="smallSize"
icon="el-icon-minus"
>结束盘点
{{ check }}
</el-button>
<el-button style="padding: 8px 7px;" type="danger" :size="smallSize" @click="deleteByType" icon="el-icon-minus">结束盘点 {{ check }}</el-button>
</el-form-item>
</div>
</el-form>
......@@ -236,7 +223,8 @@ import {
listRole,
updateRole
} 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 {roleDeptTreeselect, treeselect as deptTreeselect} from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template'
......@@ -403,6 +391,36 @@ export default {
this.title = '详情信息'
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) {
const that = this
if (!that.$refs['input' + i]) {
......
......@@ -79,9 +79,9 @@
{{ scope.row.createName || '-' }}
</template>
</el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px">
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
<span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
......
......@@ -79,9 +79,9 @@
{{ scope.row.createName || '-' }}
</template>
</el-table-column>
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="createTime" width="200px">
<el-table-column label="操作时间" :show-overflow-tooltip="true" align="center" prop="updateDate" width="200px">
<template slot-scope="scope">
<span>{{ scope.row.createTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
<span>{{ scope.row.updateDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="150px">
......
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