Commit afb273a6 by huangqy

1

parent d76f5701
import request from '@/utils/request'
export function getPageBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/GetPageBag',
method: 'post',
data
})
}
export function addOrUpdateBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/AddOrUpdateBag',
method: 'post',
data
})
}
export function deleteBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/DeleteBag',
method: 'post',
data
})
}
export function bindBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/BindBag',
method: 'post',
data
})
}
export function releaseBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/ReleaseBag',
method: 'post',
data
})
}
export function reBindBag(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/ReBindBag',
method: 'post',
data
})
}
export function addOrUpdateModel(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/AddOrUpdateModel',
method: 'post',
data
})
}
export function deleteModel(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Mission/DeleteModel',
method: 'post',
data
})
}
......@@ -55,14 +55,7 @@ export function getAllFixs(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/FixReceiveApply/GetWzByEpc',
method: 'post',
data: {
appKey: 'odykzzWm1GASj15K1AGxwQ==',
orgId: '',
version: '1.0',
timestamp: parseInt(new Date().getTime()/1000),
body: escape(JSON.stringify(data)),
sign: md5('a1dca4cf35a6d460128f5e4ad401b1c1'+parseInt(new Date().getTime()/1000)+'1.0'+escape(JSON.stringify(data)))
}
data
})
}
......
......@@ -179,14 +179,7 @@ export function getOrgListEquipmentDetail(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Inventory/GetInfoByID',
method: 'post',
data: {
appKey: 'odykzzWm1GASj15K1AGxwQ==',
orgId: '',
version: '1.0',
timestamp: parseInt(new Date().getTime()/1000),
body: escape(JSON.stringify(data)),
sign: md5('a1dca4cf35a6d460128f5e4ad401b1c1'+parseInt(new Date().getTime()/1000)+'1.0'+escape(JSON.stringify(data)))
}
data
})
}
......
......@@ -85,14 +85,7 @@ export function getListOrgWarehouse(data) {
return request({
url: window._CONFIG['serviceURL'] + '/api/Warehouse/GetListOrgWarehouse',
method: 'post',
data: {
appKey: 'odykzzWm1GASj15K1AGxwQ==',
orgId: '',
version: '1.0',
timestamp: parseInt(new Date().getTime()/1000),
body: escape(JSON.stringify(data)),
sign: md5('a1dca4cf35a6d460128f5e4ad401b1c1'+parseInt(new Date().getTime()/1000)+'1.0'+escape(JSON.stringify(data)))
}
data
})
}
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1653445288808" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6892" xmlns:xlink="http://www.w3.org/1999/xlink" width="50" height="50"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1653445288808" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6892" xmlns:xlink="http://www.w3.org/1999/xlink" width="50" height="50"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M903.928754 73.143974H120.071246a46.927272 46.927272 0 0 0-46.927272 46.927272v857.001482a46.927272 46.927272 0 0 0 46.927272 46.927272h783.857508a46.927272 46.927272 0 0 0 46.927272-46.927272V120.071246a46.927272 46.927272 0 0 0-46.927272-46.927272zM365.657303 841.140064H219.431923V768.043017H365.657303z m0-219.431924H219.431923v-73.143974H365.657303z m0-219.41628H219.431923v-73.143975H365.657303z m438.910774 438.848204H438.863847V768.043017h365.70423z m0-219.431924H438.863847v-73.143974h365.70423z m0-219.41628H438.863847v-73.143975h365.70423z" fill="#707070" p-id="6893"></path><path d="M298.832867 0m36.571988 0l0 0q36.571987 0 36.571987 36.571987l0 146.287949q0 36.571987-36.571987 36.571987l0 0q-36.571987 0-36.571988-36.571987l0-146.287949q0-36.571987 36.571988-36.571987Z" fill="#FFFFFF" p-id="6894"></path><path d="M483.257046 0m36.571987 0l0 0q36.571987 0 36.571987 36.571987l0 146.287949q0 36.571987-36.571987 36.571987l0 0q-36.571987 0-36.571987-36.571987l0-146.287949q0-36.571987 36.571987-36.571987Z" fill="#FFFFFF" p-id="6895"></path><path d="M667.665582 0m36.571987 0l0 0q36.571987 0 36.571988 36.571987l0 146.287949q0 36.571987-36.571988 36.571987l0 0q-36.571987 0-36.571987-36.571987l0-146.287949q0-36.571987 36.571987-36.571987Z" fill="#FFFFFF" p-id="6896"></path></svg>
\ No newline at end of file
......@@ -11,31 +11,17 @@
<eForm ref="form" :is-add="isAdd" @ok="handeleInit"/>
<!--表格渲染-->
<el-table ref="table" v-loading="loading" :data="data" highlight-current-row border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column prop="orgizationName" label="组织机构名称" align="center"/>
<el-table-column prop="name" label="姓名" align="center" width="160"/>
<el-table-column prop="policeCode" label="警员编号" align="center" width="120"/>
<el-table-column prop="sex" label="姓别" align="center" width="100"/>
<el-table-column prop="phone" label="手机号码" align="center" width="150"/>
<el-table-column label="单警柜" align="center">
<template slot-scope="scope">
<div>{{ scope.row.cabinetNum }}-{{ scope.row.cabinetChildNum }}</div>
</template>
</el-table-column>
<el-table-column label="人脸图片" width="150" align="center">
<template slot-scope="scope">
<el-popover placement="right" trigger="hover">
<el-card :body-style="{ padding: '0px' }">
<el-image :src="encodeURI(baseApi2 + scope.row.photo)" style="width: 160px; height: 200px"/>
<div style="padding-top: 14px;padding-bottom: 14px;padding-left: 58px;">
<span>{{scope.row.name}}</span>
</div>
</el-card>
<el-button slot="reference">查看</el-button>
</el-popover>
<el-table-column type="expand" align="center">
<template slot-scope="props">
<el-table :data="props.row.bagList" stripe border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column prop="name" label="装备名称" align="center"/>
<el-table-column prop="count" label="数量" align="center"/>
</el-table>
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" :show-overflow-tooltip="true" align="center" width="200"/>
<el-table-column prop="orgName" label="组织机构名称" align="center"/>
<el-table-column prop="name" label="装备包名称" align="center"/>
<el-table-column label="操作" width="150" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="edit(scope.row)">编辑</el-button>
......@@ -67,8 +53,7 @@
<script>
import { mapGetters } from 'vuex'
import checkPermission from '@/utils/permission'
import { deletePoliceman } from '@/api/policeman'
import { deleteBag } from '@/api/bag'
import { getListOrg } from '@/api/org'
import initData from '@/mixins/initData'
import Treeselect from '@riophae/vue-treeselect'
......@@ -84,6 +69,7 @@ export default {
filterText: '',
selection: '',
orgId: this.$store.state.user.user.baseJpOrganization.id,
roleIds: this.$store.state.user.user.roleIds,
columns: [],
allColumnsSelected: true,
allColumnsSelectedIndeterminate: false,
......@@ -104,24 +90,12 @@ export default {
delLoading: false
}
},
computed: {
...mapGetters([
'baseApi2'
])
},
created() {
this.initTree()
this.$nextTick(() => {
this.initPost()
})
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
methods: {
checkPermission,
beforeInit() {
this.url = window._CONFIG['serviceURL'] + '/api/Mission/GetPageBag'
this.params = { page: this.page, size: this.size, orgId: this.orgId }
......@@ -130,20 +104,10 @@ export default {
if (name) { this.params['name'] = name }
return true
},
initTree() {
const params = { id : this.$store.state.user.user.baseJpOrganization.id }
getListOrg(params).then(res => {
this.tData = res.data
})
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
subDelete(id) {
this.delLoading = true
const params = {id:id}
deletePoliceman(params).then(res => {
deleteBag(params).then(res => {
if (res.code == '10000') {
this.dleChangePage()
this.initPost()
......@@ -166,8 +130,7 @@ export default {
add() {
this.isAdd = true
const _this = this.$refs.form
_this.initOrg()
_this.initCabinets(this.$store.state.user.user.baseJpOrganization.id)
_this.initEquList()
_this.dialog = true
},
edit(data) {
......@@ -176,79 +139,15 @@ export default {
_this.form = {
id: data.id,
name: data.name,
orgizationCode: data.orgizationCode,
policeCode: data.policeCode,
sex: data.sex,
isCreatedAccount: data.isCreatedAccount,
photo: data.photo,
phone: data.phone,
cabinetId: data.cabinetId,
updateUser: this.$store.state.user.user.id
bagList: data.bagList,
orgId: this.orgId
}
_this.initOrg()
_this.initCabinets(data.orgizationCode)
_this.initEquList()
_this.dialog = true
},
handeleInit() {
this.initPost()
},
handleNodeClick(data) {
this.selection = data
this.orgizationCode = data.id
this.initPost()
},
handleCheckAllChange(val) {
if (val === false) {
this.allColumnsSelected = true
return
}
this.columns.forEach(column => {
if (!column.visible) {
column.visible = true
this.updateColumnVisible(column)
}
})
this.allColumnsSelected = val
this.allColumnsSelectedIndeterminate = false
},
handleCheckedTableColumnsChange(item) {
let totalCount = 0
let selectedCount = 0
this.columns.forEach(column => {
++totalCount
selectedCount += column.visible ? 1 : 0
})
if (selectedCount === 0) {
this.$notify({
title: '请至少选择一列',
type: 'warning',
duration: 2500
})
this.$nextTick(function() {
item.visible = true
})
return
}
this.allColumnsSelected = selectedCount === totalCount
this.allColumnsSelectedIndeterminate = selectedCount !== totalCount && selectedCount !== 0
this.updateColumnVisible(item)
},
updateColumnVisible(item) {
const table = this.$refs['table']
const vm = table.$children.find(e => e.prop === item.property)
const columnConfig = vm.columnConfig
if (item.visible) {
let columnIndex = -1
// 找出合适的插入点
table.store.states.columns.find(e => {
columnIndex++
return e.__index !== undefined && e.__index > columnConfig.__index
})
vm.owner.store.commit('insertColumn', columnConfig, columnIndex, null)
} else {
vm.owner.store.commit('removeColumn', columnConfig, null)
}
}
}
}
</script>
......
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '装备包绑定' : '编辑装备包'" width="1500px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="仓库名称">
<el-select v-model="form.warehouseId" placeholder="请选择仓库" filterable clearable style="width: 240px;" @change="handleChangeWarehouse">
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="装备包名称">
<el-select v-model="form.bagId" placeholder="请选择装备包" filterable clearable style="width: 240px;" @change="handleChangeBag">
<el-option v-for="item in bagList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="success" round plain icon="el-icon-video-play" style="width:240px" @click="readEpcs" @loading="loading">读取</el-button>
</el-form-item>
</el-col>
<el-col :span="16">
<el-table :data="bagReadList" class="form-table" border :row-class-name="tableRowClassName">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column prop="name" align="center" label="装备名称" />
<el-table-column prop="count" align="center" label="装备数量"/>
<el-table-column align="center" label="识别数量">
<template slot-scope="scope">
{{scope.row.readCount ? scope.row.readCount : 0}}
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel" type="info" plain>关闭</el-button>
<el-button type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { getPageBag, bindBag } from '@/api/bag'
import { getListEquipmentDetail } from '@/api/equipmentDetail'
import { getWzByEpc } from '@/api/fixReceiveApply'
import { getListOrgWarehouse } from '@/api/warehouse'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
bagList: [],
bagReadList: [],
warehouseList: [],
dataCopy: [],
data: [],
epcList: [],
orgId: this.$store.state.user.user.baseJpOrganization.id,
form: {
bagId: '',
warehouseId: '',
equipmentList: []
},
rules: {
name: [
{ required: true, message: '请输入装备包名称', trigger: 'blur' }
]
}
}
},
methods: {
tableRowClassName({row, rowIndex}) {
if (row.readCount !== row.count) {
return 'warning-row';
} else {
return 'success-row';
}
return '';
},
initWarehouseList() {
getListOrgWarehouse({ orgizationId: this.orgId }).then(res => {
if (res.code === '10000') {
this.warehouseList = res.data
} else {
this.$message.error(res.msg)
}
})
},
initBagList() {
getPageBag({page: 0, size: 99, orgId: this.orgId}).then(res => {
if (res.code === '10000') {
this.bagList = res.data.content
} else {
this.$message.error(res.msg)
}
})
},
handleChangeWarehouse() {
this.epcList = []
},
handleChangeBag(value) {
this.bagReadList = []
this.epcList = []
if (value) {
let obj = this.bagList.find(i => i.id === this.form.bagId)
this.bagReadList = obj.bagList
}
},
readEpcs() {
this.loading = true
this.websock = new WebSocket('ws://127.0.0.1:8081');
this.websock.onopen = this.websocketOnopen;
this.websock.onerror = this.websocketOnerror;
this.websock.onmessage = this.websocketOnmessage;
this.websock.onclose = this.websocketOnclose;
},
websocketOnopen(e) {
console.log('WebSocket连接建立');
this.websock.send(JSON.stringify({CmdType:0, Content:""}))
},
websocketOnerror: function (e) {
console.log("WebSocket连接发生错误");
// this.reconnect();
},
websocketOnmessage: function (e) {
console.log(e)
var backMessObj = JSON.parse(e.data);
const that = this
if(backMessObj.CmdType == 2) {
if (!this.epcList.includes(backMessObj.Content)) { // 如果不包含则增加
this.epcList.push(backMessObj.Content)
getWzByEpc({epc: backMessObj.Content}).then(res => {
if(res.code == '10000') {
if (res.data.warehouseId !== this.form.warehouseId) {
return this.$message.error(res.data.equipmentName + '属于' + res.data.warehouseName + ',无法绑定')
}
if (res.data.isBindBag) {
return this.$message.error(res.data.equipmentName + '已经绑定过其他装备包,无法绑定')
}
var foundIndex = this.bagReadList.findIndex(i => i.detailId === res.data.equipmentId)
if (foundIndex > -1) {
this.form.equipmentList.push({epc: res.data.epc})
var num = (that.bagReadList[foundIndex].readCount ? that.bagReadList[foundIndex].readCount : 0) + 1
that.$set(that.bagReadList[foundIndex],'readCount', num)
}
} else {
this.$message.error(res.msg)
}
})
}
} else if (![0,1,2,5].includes(backMessObj.CmdType)){
this.$message.error(backMessObj.Content)
}
setTimeout(() => {
this.websock.close()
this.loading = false
}, 1000)
},
websocketOnclose: function (e) {
console.log("connection closed (" + e + ")");
},
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
this.doAdd()
}
})
},
doAdd() {
var flag = false
this.bagReadList.forEach((e, index) => {
if (e.count !== e.readCount) {
flag = true
setTimeout(() => {
this.$message.warning(e.name + '绑定数量与标准不匹配')
}, 1000)
}
})
if(flag) return;
bindBag(this.form).then(res => {
if (res.code === '10000') {
this.resetForm()
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
this.$emit('ok')
} else {
this.$message.error(res.msg)
}
}).catch(err => {
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.bagReadList = []
this.epcList = []
this.form = {
bagId: '',
warehouseId: '',
equipmentList: []
}
},
}
}
</script>
<style>
.el-table .warning-row {
background: oldlace !important;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增预案' : '编辑预案'" width="1200px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="预案名称" prop="name">
<el-input v-model.trim="form.name" style="width: 240px;" placeholder="请输入预案名称"/>
</el-form-item>
<el-form-item label="是否默认">
<el-select v-model="form.isDefault" placeholder="请选择是否默认" filterable clearable style="width: 240px;">
<el-option label="默认" :value="true"/>
<el-option label="自定义" :value="false"/>
</el-select>
</el-form-item>
<el-form-item label="物资类型">
<el-select v-model="type" placeholder="请选择物资类型" filterable clearable style="width: 240px;">
<el-option label="装备包" value="bag"/>
<el-option label="装备" value="equipment"/>
</el-select>
</el-form-item>
<el-form-item label="装备包" v-if="type === 'bag'">
<el-select v-model="bagId" placeholder="请选择装备包" filterable clearable style="width: 240px;">
<el-option v-for="item in bagList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="装备名称" v-if="type === 'equipment'">
<el-select v-model="detailId" placeholder="请选择装备类型" filterable clearable style="width: 240px;">
<el-option v-for="item in equipmentList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="success" round plain icon="el-icon-plus" style="width:240px" @click="handleAdd">添加</el-button>
</el-form-item>
</el-col>
<el-col :span="16">
<el-table :data="form.modelList" class="form-table" border>
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column prop="name" align="center" label="名称" />
<el-table-column prop="type" align="center" label="类型">
<template slot-scope="scope">
{{ scope.row.type === 'bag'? '装备包': '装备' }}
</template>
</el-table-column>
<el-table-column align="center" label="数量">
<template slot-scope="scope">
<el-input-number v-model="scope.row.count" size="small" :min="1" :max="100" :precision="0"/>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button size="mini" type="danger" round plain icon="el-icon-delete" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel" type="info" plain>关闭</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { addOrUpdateModel } from '@/api/bag'
import { getPageBag } from '@/api/bag'
import { getListEquipmentDetail } from '@/api/equipmentDetail'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
orgId: this.$store.state.user.user.baseJpOrganization.id,
type: '',
bagId: '',
bagList: [],
detailId: '',
equipmentList: [],
form: {
id: '',
orgId: this.$store.state.user.user.baseJpOrganization.id,
name: '',
modelList: []
},
rules: {
name: [
{ required: true, message: '请输入预案名称', trigger: 'blur' }
]
}
}
},
methods: {
initEquList() {
getListEquipmentDetail({}).then(res => {
this.equipmentList = res.data
})
},
initBagList() {
getPageBag({page: 0, size: 99, orgId: this.orgId}).then(res => {
if (res.code === '10000') {
this.bagList = res.data.content
} else {
this.$message.error(res.msg)
}
})
},
handleAdd() {
let obj = {}
let row = {}
if (this.type === 'equipment') {
obj = this.equipmentList.find((item) => {
return item.id === this.detailId
});
row = {
typeName: '装备',
type : 'equipment',
typeId: this.detailId,
name: obj.name,
count: 1
}
} else if (this.type === 'bag') {
obj = this.bagList.find((item) => {
return item.id === this.bagId
});
row = {
typeName: '装备包',
type : 'bag',
typeId: this.bagId,
name: obj.name,
count: 1
}
}
var result = this.form.modelList.find(i => i.typeId === row.typeId)
if (result) {
this.$message.warning('已经被添加')
} else {
this.form.modelList.unshift(row)
}
},
handleDelete(index, row) {
this.form.bagList.splice(index, 1)
},
cancel() {
this.resetForm()
},
doSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
this.doAdd()
}
})
},
doAdd() {
addOrUpdateModel(this.form).then(res => {
if (res.code === '10000') {
this.resetForm()
this.$notify({
title: res.msg,
type: 'success',
duration: 2500
})
this.$emit('ok')
} else {
this.$message.error(res.msg)
}
this.loading = false
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
name: '',
orgId: this.$store.state.user.user.baseJpOrganization.id,
modelList: []
}
},
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-input-number .el-input__inner {
text-align: left;
}
/deep/ .el-select-group__title {
padding-left: 20px;
font-size: 15px;
color: #909399;
line-height: 30px;
}
/deep/ .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
/deep/ .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
/deep/ .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
/deep/ .avatar {
width: 160px;
height: 200px;
display: block;
}
</style>
<template>
<div class="dashboard-editor-container">
<el-card>
<!-- 搜索 -->
<div class="head-container">
<el-input v-model="query.name" clearable placeholder="请输入名称" style="width: 200px;margin-left: 0px;" class="filter-item" @keyup.enter.native="toPostQuery"/>
<el-button class="filter-item" type="success" icon="el-icon-search" @click="toPostQuery">搜索</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-plus" style="float: right" @click="add">新增</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" @ok="handeleInit"/>
<!--表格渲染-->
<el-table ref="table" v-loading="loading" :data="data" highlight-current-row border style="width: 100%;">
<el-table-column type="expand" align="center">
<template slot-scope="props">
<el-table :data="props.row.bagList" stripe border style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="50"/>
<el-table-column prop="name" label="装备名称" align="center"/>
<el-table-column prop="count" label="数量" align="center"/>
</el-table>
</template>
</el-table-column>
<el-table-column prop="orgName" label="组织机构名称" align="center"/>
<el-table-column prop="name" label="装备包名称" align="center"/>
<el-table-column label="操作" width="150" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="edit(scope.row)">编辑</el-button>
<el-popover
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" size="mini">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="postSizeChange"
@current-change="postPageChange"/>
</el-card>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { deleteModel } from '@/api/bag'
import { getListOrg } from '@/api/org'
import initData from '@/mixins/initData'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import eForm from './form'
export default {
name: 'Person',
components: { eForm, Treeselect },
mixins: [initData],
// 设置数据字典
data() {
return {
filterText: '',
selection: '',
orgId: this.$store.state.user.user.baseJpOrganization.id,
roleIds: this.$store.state.user.user.roleIds,
columns: [],
allColumnsSelected: true,
allColumnsSelectedIndeterminate: false,
show: true,
tData: [],
defaultProps:{
children: 'children',
label: 'name'
},
level: '本级',
normalizer(node) { //自定义键名
return {
id: node.id,
label: node.name,
children: node.children,
}
},
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.initPost()
})
},
methods: {
beforeInit() {
this.url = window._CONFIG['serviceURL'] + '/api/Mission/GetPageModel'
this.params = { page: this.page, size: this.size, orgId: this.orgId }
const query = this.query
const name = query.name
if (name) { this.params['name'] = name }
return true
},
subDelete(id) {
this.delLoading = true
const params = {id:id}
deleteModel(params).then(res => {
if (res.code == '10000') {
this.dleChangePage()
this.initPost()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
} else {
this.$message.error(res.msg)
}
this.delLoading = false
this.$refs[id].doClose()
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
const _this = this.$refs.form
_this.initEquList()
_this.initBagList()
_this.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
name: data.name,
isDefault: data.isDefault,
modelList: data.modelList,
orgId: this.orgId
}
_this.initBagList()
_this.initEquList()
_this.dialog = true
},
handeleInit() {
this.initPost()
},
}
}
</script>
<style scoped>
.dev-type-main-left {
overflow: auto;
padding: 10px;
}
.right-menu {
z-index: 1;
position: absolute;
height: 100px;
width: 100px;
position: absolute;
border-radius: 5px;
border: 1px solid #ccc;
background-color: white;
}
.menu-item {
line-height: 20px;
text-align: left;
margin-top: 10px;
font-size: 14px;
color: #606266;
}
li:hover {
background-color: #edf6ff;
color: #606266;
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 10px 12px 12px 12px;
background-color: rgb(240, 242, 245);
}
</style>
<template>
<div class="dashboard-editor-container">
<el-card>
<div style="margin-left:20px">
<!-- 搜索栏开始 -->
<div class="head-container">
<el-select v-model="query.warehouseId" placeholder="请选择仓库" clearable style="width: 240px;padding-bottom: 10px;display: inline-block;vertical-align: middle;"
@change="toPostQuery">
<el-option
v-for="item in warehouseList"
:key="item.name"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-date-picker
v-model="query.date"
type="daterange"
range-separator=":"
class="filter-item"
style="width: 260px"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="toPostQuery">搜索</el-button>
<el-button type="primary" class="filter-item" style="float: right" @click="add">出警任务</el-button>
</div>
<!--表单组件-->
<apply-form ref="applyForm" :is-add="isAdd" />
<!-- <list-form ref="listForm" /> -->
<!--表格开始-->
<el-table v-loading="loading" :data="data" style="width: 100%;" stripe border :header-cell-style="{'text-align':'center'}">
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="orderCode" label="领用单号" align="center"/>
<el-table-column prop="warehouseName" label="目标仓库" align="center"/>
<el-table-column prop="applyName" label="创建人" align="center"/>
<el-table-column prop="applyTime" label="创建时间" align="center"/>
<el-table-column prop="note" label="领用原因" :show-overflow-tooltip="true" align="center"/>
<el-table-column label="操作" width="200" align="left" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="edit(scope.row)" :disabled="scope.row.changeFlag === 1">编辑</el-button>
<el-popover
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" size="mini" :disabled="scope.row.changeFlag === 1">删除</el-button>
</el-popover>
<el-button size="mini" type="primary" @click="show(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="postSizeChange"
@current-change="postPageChange"/>
</div>
</el-card>
</div>
</template>
<script>
import initData from '@/mixins/initData'
import applyForm from './form'
// import listForm from '../apply/detailForm'
import { deleteOrder, getByID } from '@/api/borrow'
export default {
name: 'ReceiveCommon',
mixins: [initData],
props: ['warehouseList'],
components: { applyForm },
data() {
return {
loading: false,
delLoading: false,
}
},
created() {
this.query.orderId = this.$route.query.orderId
},
methods: {
tabChange() {
this.query = {}
this.$nextTick(() => {
this.initPost()
})
},
beforeInit() {
this.url = window._CONFIG['serviceURL'] + '/api/Borrow/GetAllBorrowOrderList'
this.params = { page: this.page, size: this.size, actionType: 1, applyId: this.$store.state.user.user.id, orgId: this.$store.state.user.user.baseJpOrganization.id }
const warehouseId = this.query.warehouseId // 仓库
const date = this.query.date // 日期
if (warehouseId !== '' && warehouseId !== null) { this.params['warehouseId'] = warehouseId }
if (date) {
this.params['startTime'] = date[0]
this.params['endTime'] = date[1]
}
return true
},
add() {
this.isAdd = true
this.$refs.applyForm.getListOrgWarehouse(this.isAdd)
this.$refs.applyForm.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.applyForm
_this.getListOrgWarehouse(this.isAdd)
_this.form = {
id: data.id,
applyId: data.applyId,
applyName: data.applyName,
detailList: data.detailList,
orgCode: data.orgCode,
orgId: data.orgId,
warehouseId: data.warehouseId,
note: data.note
}
_this.dialog = true
},
show(data) {
const _this = this.$refs.listForm
getByID({id: data.id}).then(res => {
if(res.code == '10000') {
_this.form = res.data
_this.getSteps()
} else {
this.$message.error(res.msg)
}
})
_this.dialog = true
},
subDelete(id) {
this.delLoading = true
deleteOrder({id: id}).then(res => {
if(res.code ==='10000') {
this.$refs[id].doClose()
this.dleChangePage()
this.initPost()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
} else {
this.$message.error(res.msg)
}
this.delLoading = false
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论