作者 朱兆平

add:

1. 增加危险品代码管理界面.
2. 出入库管理增加危险品代码录入
import http from "../http";
let baseServiceURL = 'wms-server-warehouse/common';
// 新增联合国危险品编码信息
export const insertUnCodeInfo = (data) => {
return http.post(`${baseServiceURL}/unCode/insert`, data);
};
// 更新联合国危险品编码信息
export const updateUnCodeInfo = (data) => {
return http.post(`${baseServiceURL}/unCode/update`, data);
};
// 删除单个联合国危险品编码信息
export const deleteUnCodeById = (params) => {
return http.get(`${baseServiceURL}/unCode/delete`, { params: params });
};
// 查询单个联合国危险品编码信息
export const selectUnCodeById = (params) => {
return http.get(`${baseServiceURL}/unCode/getById`, { params: params });
};
// 根据危险品编码进行查询
export const selectByUnCode = (params) => {
return http.get(`${baseServiceURL}/unCode/getByUnCode`, params);
};
// 分页查询所有UN代码信息
export const getAllUnCodesByPage = (data,params) => {
return http.post(`${baseServiceURL}/unCode/getAllByPage`, data,params);
};
... ...
... ... @@ -126,6 +126,7 @@ import area from './views/deploy/area.vue'
import seller from './views/deploy/seller.vue'
import classification from './views/deploy/classification.vue'
import subscribe from './views/deploy/subscribe.vue'
import UNcode from './views/wms/UNcode.vue'
... ... @@ -588,6 +589,7 @@ let routes = [
{path:'/seller',component:seller,name:'商品管理'},
{path:'/classification',component:classification,name:'分类监管申请'},
{path:'/subscribe',component:subscribe,name:'分类监管查询'},
{path:'/unCode',component:UNcode,name:'国际危险品代码管理'},
]
},
{
... ...
... ... @@ -166,20 +166,61 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="remark1">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">备&emsp;&emsp;注</div>
<el-input v-model="addForm.remark1"
type="textarea"
autosize
placeholder="备注信息"
style="float: left;width:calc(100% - 110px)"
>
</el-input>
</div>
</el-form-item>
<el-form-item prop="remark5">
<el-input v-model="addForm.remark5" autocomplete="off" suffix-icon="el-icon-edit">
<template slot="prepend"><i v-if="rules.hasOwnProperty('remark5')" style="color:red;">*</i> 货物品名</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item prop="uncode">
<el-autocomplete
v-model="addForm.uncode"
:fetch-suggestions="unCodeQuerySearch"
placeholder="联合国危险品编号如:0004"
:trigger-on-focus="false"
value-key = "unCode"
clearable
highlight-first-item
style="width: 100%"
suffix-icon="el-icon-edit"
@select="unCodeHandleSelect"
>
<template slot="prepend"><i v-if="rules.hasOwnProperty('uncode')" style="color:red;">*</i> UN编号</template>
<template slot-scope="{ item }">
<ul style="padding: 0">
<li style="padding: 0"><el-tag>{{ item.unCode }}</el-tag>: {{ item.cnDes }}</li>
<li style="padding: 0">EN: {{ item.enDes }}</li>
<li style="padding: 0">类/项: {{ item.classType }}</li>
</ul>
</template>
</el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="unclass">
<el-input v-model="addForm.unclass" autocomplete="off" suffix-icon="el-icon-edit" placeholder="危险品类别/项别">
<template slot="prepend"><i v-if="rules.hasOwnProperty('unclass')" style="color:red;">*</i> 类别/项别</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="remark1">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">备&emsp;&emsp;注</div>
<el-input v-model="addForm.remark1"
type="textarea"
autosize
placeholder="备注信息"
style="float: left;width:calc(100% - 110px)"
>
</el-input>
</div>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider>
<el-row>
<!-- <el-col :span="6">-->
... ... @@ -213,6 +254,7 @@
clearable
highlight-first-item
style="width: 100%"
suffix-icon="el-icon-location-information"
>
<template slot="prepend"><i v-if="rules.hasOwnProperty('location')" style="color:red;">*</i> 库&emsp;&emsp;位</template>
<template slot-scope="{ item }">
... ... @@ -240,6 +282,7 @@
clearable
highlight-first-item
style="width: 100%"
suffix-icon="el-icon-user"
>
<template slot="prepend">货主名称</template>
<template slot-scope="{ item }">
... ... @@ -708,10 +751,11 @@
import unusualOP from '@/api/wms/unusualOptions'
import damageOP from '@/api/wms/damageOptions'
import Print from '@/components/Print'
import { selectByUnCode } from '@/api/wms/uncodeAPI';
export default {
name: "inventroyrecord",
name: "inventroy-record",
components:{Print},
data() {
var checkInputArea = (rule, value, callback) => {
... ... @@ -827,7 +871,9 @@
remark3:'',
remark4:'',
remark5:'',
annex:''
annex:'',
uncode: '',
unclass: ''
},
packgeOptions:packge,
options: [{
... ... @@ -1121,6 +1167,40 @@
return (restaurant.locationno.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
unCodeHandleSelect(item){
console.log(item)
this.addForm.unclass = item.classType;
},
unCodeFilter(queryString) {
return (restaurant) => {
return (restaurant.unCode.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
unCodeQuerySearch(queryString,cb) {
if (queryString && queryString.length > 0) {
let _this=this
let ld = this.$loading({
text:"数据加载中..."
})
selectByUnCode({unCode:queryString}).then(response => {
if (response.data.code === "200") {
const data = response.data;
if (data.code === "200") {
_this.$message.success('加载记录成功!')
const restaurants = data.data || [];
const results = queryString ? restaurants.filter(this.unCodeFilter(queryString)) : restaurants;
// 调用 callback 返回建议列表的数据
cb(results);
}
}
}).catch(e =>{
this.$message.error(e.toString())
}).finally(()=>{
ld.close()
});
}
},
getRoles() {
let _this= this;
let ld = this.$loading({
... ... @@ -1335,6 +1415,50 @@
},
nextBill(){
this.$refs.addForm.resetFields()
this.addForm = {
area: '',
feeweight: 0,
custel: '',
customer: '',
custcode: '',
goodstype: '运单',
house:'',
ietype:'I',
location:'',
opter:'',
opttime: '',
pcs: 0,
totalpcs:0,
serialnumber: '',
station: '',
status: '',
licenseplate: '',
transtype:'销售入库',
goodssize:'',
goodsvol:0,
waybill:'',
billfhl:'',
//随货文件
hasFiles:false,
hasUnusual:false,
unusuals:[],
files:[],
damages:[],
sphCodes:[],
billweight:0,
totalweight:0,
packingid:'',
remark:'',
remark1:'',
remark2:'',
remark3:'',
remark4:'',
remark5:'',
annex:'',
uncode: '',
unclass: ''
}
this.initUserInfo()
this.tableData = []
... ...
<template>
<div>
<!-- 查询区域 -->
<el-row :gutter="10" class="toolbar">
<el-col :span="7">
<el-input v-model="queryInfo.unCode" prefix-icon="el-icon-search" size="small"
placeholder="联合国危险品代码" clearable></el-input>
</el-col>
<el-col :span="6">
<el-button type="primary" icon="el-icon-search" size="small" @click="search">查询</el-button>
<el-button type="success" icon="el-icon-plus" size="small" @click="applyAdd()">新增</el-button>
</el-col>
</el-row>
<!-- 表格区域 -->
<el-table :data="tableData" border stripe style="width: 100%" size="small"
:header-cell-style="{background:'#6F8294',color:'#FFFFFF'}">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column prop="id" label="主键ID" width="100"></el-table-column>
<el-table-column prop="unCode" label="联合国危险品代码"></el-table-column>
<el-table-column prop="cnDes" label="危险品中文描述"></el-table-column>
<el-table-column prop="enDes" label="危险品英文描述"></el-table-column>
<el-table-column prop="classType" label="危险品项别/类别"></el-table-column>
<el-table-column prop="secondaryRisk" label="次要危险性"></el-table-column>
<el-table-column prop="packingLevel" label="包装等级"></el-table-column>
<el-table-column fixed="right" label="操作">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="applyDelete(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页区域 -->
<el-pagination
background
layout="prev, pager, next"
:total="total"
:current-page="queryInfo.pageNum"
:page-size="queryInfo.pageSize"
@current-change="handlePageChange">
</el-pagination>
<!-- 对话框 -->
<el-dialog :title="dialogStateMap[dialogType]" :visible.sync="showDialog" width="80%">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="联合国危险品代码" prop="unCode">
<el-input v-model="formData.unCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="危险品中文描述" prop="cnDes">
<el-input v-model="formData.cnDes"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="危险品英文描述" prop="enDes">
<el-input v-model="formData.enDes"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="危险品项别/类别" prop="classType">
<el-input v-model="formData.classType"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="次要危险性" prop="secondaryRisk">
<el-input v-model="formData.secondaryRisk"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="包装等级" prop="packingLevel">
<el-input v-model="formData.packingLevel"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="showDialog = false">取消</el-button>
<el-button type="primary" @click="submitForm(dialogType)">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { insertUnCodeInfo, updateUnCodeInfo, deleteUnCodeById, getAllUnCodesByPage } from '@/api/wms/uncodeAPI';
export default {
data() {
return {
queryInfo: {
pageNum: 1,
pageSize: 10,
unCode: ''
},
tableData: [],
total: 0,
showDialog: false,
dialogType: 'add',
dialogStateMap: {
view: '查看',
edit: '编辑',
add: '新增'
},
formData: {},
rules: {
unCode: [
{ required: true, message: '请输入联合国危险品代码', trigger: 'blur' }
],
cnDes: [
{ required: true, message: '请输入危险品中文描述', trigger: 'blur' }
]
// 其他字段的规则类似
},
};
},
methods: {
search() {
getAllUnCodesByPage({unCode:this.queryInfo.unCode},{pageNum:this.queryInfo.pageNum, pageSize:this.queryInfo.pageSize}).then(response => {
const data = response.data;
if (data.code === "200") {
this.tableData = data.data.list || [];
this.total = data.data.total || 0;
}
});
},
applyAdd() {
this.dialogType = 'add';
this.showDialog = true;
this.formData = {};
},
applyEdit(row) {
this.dialogType = 'edit';
this.showDialog = true;
this.formData = { ...row };
},
applyDelete(id) {
deleteUnCodeById(id).then(response => {
if (response.data.code === "200") {
this.search();
}
});
},
submitForm(type) {
let method;
switch (type) {
case 'add':
method = insertUnCodeInfo;
break;
case 'edit':
method = updateUnCodeInfo;
break;
default:
return;
}
this.$refs['formRef'].validate(valid => {
if (valid) {
method(this.formData).then(response => {
if (response.data.code === "200") {
this.showDialog = false;
this.search();
}
}).catch(e =>{
this.$message.error(e)
});
} else {
console.log('验证失败');
return false;
}
});
},
handlePageChange(page) {
this.queryInfo.pageNum = page;
this.search();
}
},
};
</script>
... ...