多级产品代码提交
parent
f7de3e4451
commit
71b7b3c87a
@ -0,0 +1,44 @@
|
||||
import axios from '@/utils/request'
|
||||
|
||||
export function getList(query) {
|
||||
return axios({
|
||||
url: "/udi/ioCode/Rel/list",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
export function getDelectList(query) {
|
||||
return axios({
|
||||
url: "/udi/ioCode/Rel/delectList",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
export function delIoCodeRel(query) {
|
||||
return axios({
|
||||
url: "/udi/ioCode/Rel/del",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
export function checkUpProduct(query) {
|
||||
return axios({
|
||||
url: "/udi/ioCode/Rel/checkUpProduct",
|
||||
method: "get",
|
||||
params: query,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
export function checkLowProduct(query) {
|
||||
return axios({
|
||||
url: "/udi/ioCode/Rel/checkLowProduct",
|
||||
method: "get",
|
||||
params: query,
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" label-width="100px" v-show="showSearch">
|
||||
<el-row>
|
||||
<!-- <el-col :span="10">-->
|
||||
<!-- <el-form-item label="udi">-->
|
||||
<!-- <el-input v-model="filterQuery.code" style="width: 90%" placeholder="请输入udi" clearable></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item label="产品编码">
|
||||
<el-input v-model="filterQuery.nameCode" style="width: 90%" placeholder="请输入产品编码"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="filterQuery.ggxh" style="width: 90%" placeholder="请输入规格型号" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="10">
|
||||
<el-form-item label="产品名称">
|
||||
<el-input v-model="filterQuery.cpmctymc" style="width: 90%" placeholder="请输入产品名称"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="top-right-btn">
|
||||
<el-button-group style="display:flex;">
|
||||
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="onReset">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSubmitFind">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="newDistributionForm()" :loading="loading">新增
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table v-loading="loading" :data="list" border highlight-current-row
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
style="width: 100%" row-key="id" >
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="上级编码" prop="parentCode"></el-table-column>
|
||||
<el-table-column label="产品编码" prop="nameCode"></el-table-column>
|
||||
<el-table-column label="产品名称" prop="cpmctymc"></el-table-column>
|
||||
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
|
||||
<el-table-column label="序列号" prop="serialNo"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click.native="newDistributionForm(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="filterQuery.page"
|
||||
:limit.sync="filterQuery.limit"
|
||||
@pagination="handleCurrentChange"
|
||||
|
||||
></pagination>
|
||||
|
||||
<el-dialog
|
||||
:title="formName"
|
||||
:visible.sync="newSpDistributionVisible"
|
||||
width="80%"
|
||||
v-if="newSpDistributionVisible"
|
||||
@close='closeDialog'
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<ioCodeRelEdit
|
||||
:closeDialog="closeDialog"
|
||||
:idQuery="idQuery"
|
||||
></ioCodeRelEdit>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {delIoCodeRel, getList} from "@/api/inout/ioCodeRel";
|
||||
import ioCodeRelEdit from "@/views/inout/codeRel/ioCodeRelEdit"
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
newSpDistributionVisible: false,
|
||||
filterQuery: {
|
||||
billAction: null,
|
||||
billNo: "",
|
||||
originType: null,
|
||||
thirdSysFk: "",
|
||||
page: 1,
|
||||
limit: 10,
|
||||
corpName: null,
|
||||
type: 1,
|
||||
editStatus: 1,
|
||||
},
|
||||
isExpandAll: true,
|
||||
idQuery: null,
|
||||
formName: null,
|
||||
loading: false,
|
||||
list: [],
|
||||
formData: null,
|
||||
total: 0,
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "最近一周",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "最近三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit("pick", [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
billNo: "",
|
||||
thirdSysFk: "",
|
||||
billFlag: null,
|
||||
billAction: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
corpName: null,
|
||||
type: 1,
|
||||
editStatus: 1,
|
||||
};
|
||||
this.actDateRange = [];
|
||||
this.getList();
|
||||
},
|
||||
onSubmitFind() {
|
||||
this.filterQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
hideSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
newDistributionForm(index, row) {
|
||||
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
|
||||
this.idQuery = row;
|
||||
this.formName = "编辑";
|
||||
this.newSpDistributionVisible = true;
|
||||
} else {
|
||||
this.formName = "新增";
|
||||
this.newSpDistributionVisible = true;
|
||||
}
|
||||
},
|
||||
closeDialog() {
|
||||
this.newSpDistributionVisible = false;
|
||||
this.getList();
|
||||
this.detailList = [];
|
||||
},
|
||||
deleteDialog(row) {
|
||||
delIoCodeRel({parentCode:row.parentCode})
|
||||
.then((response) => {
|
||||
if (response.code == 20000) {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getList(this.filterQuery)
|
||||
.then((response) => {
|
||||
if (response.code == 20000) {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
});
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val.page;
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
components: {
|
||||
ioCodeRelEdit,
|
||||
Treeselect,
|
||||
},
|
||||
filters: {},
|
||||
mounted() {
|
||||
}
|
||||
,
|
||||
created() {
|
||||
this.getList();
|
||||
}
|
||||
,
|
||||
}
|
||||
;
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="el-card">
|
||||
<el-form :model="filterQuery" class="query-form" label-width="100px" >
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="上级产品">
|
||||
<el-input v-model="filterQuery.upProduct " :disabled="isUp" style="width: 80%" placeholder="请输入多级产品" clearable></el-input>
|
||||
<el-button style="margin-left: 10px" :disabled="isUp" type="primary" @click="addUpProduct()">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="下级产品">
|
||||
<el-input v-model="filterQuery.lowProduct" style="width: 80%" placeholder="请输入下级产品" clearable></el-input>
|
||||
<el-button style="margin-left: 10px" :disabled="isLow" type="primary" @click="addLowProduct()">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="list" style="width: 100%" border highlight-current-row>
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="UDI码" prop="code"></el-table-column>
|
||||
<el-table-column label="产品编码" prop="nameCode"></el-table-column>
|
||||
<el-table-column label="产品名称" prop="cpmctymc"></el-table-column>
|
||||
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
|
||||
<el-table-column label="序列号" prop="serialNo"></el-table-column>
|
||||
<el-table-column label="生产企业" prop="manufactory"></el-table-column>
|
||||
<el-table-column label="计量单位" prop="measname"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="filterQuery.page"
|
||||
:limit.sync="filterQuery.limit"
|
||||
@pagination="handleCurrentChange"
|
||||
></pagination>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {checkLowProduct, checkUpProduct, getDelectList, getList} from "@/api/inout/ioCodeRel";
|
||||
import ioCodeRelEdit from "@/views"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
idQuery: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
newSpDistributionVisible: false,
|
||||
filterQuery: {
|
||||
upProduct:'',
|
||||
lowProduct:'',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
isLow:true,
|
||||
isUp:false,
|
||||
upCode:null,
|
||||
formName:null,
|
||||
loading:false,
|
||||
list:[],
|
||||
formData:null,
|
||||
total:0,
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onReset() {
|
||||
this.$router.push({
|
||||
path: "",
|
||||
});
|
||||
this.filterQuery = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.filterQuery.page = val.page;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
if (this.filterQuery.upProduct!=null){
|
||||
this.filterQuery.parentCode=this.filterQuery.upProduct
|
||||
}
|
||||
getDelectList(this.filterQuery)
|
||||
.then((response) => {
|
||||
if (response.code == 20000) {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total || 0;
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
});
|
||||
},
|
||||
addUpProduct(){
|
||||
checkUpProduct({code:this.filterQuery.upProduct}).then((res)=>{
|
||||
if(res.code==20000){
|
||||
this.isLow=false;
|
||||
this.isUp=true;
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.$message.error("扫码错误!");
|
||||
})
|
||||
},
|
||||
addLowProduct(){
|
||||
checkLowProduct({lowCode:this.filterQuery.lowProduct,upCode:this.filterQuery.upProduct}).then((res)=>{
|
||||
if(res.code==20000){
|
||||
this.getList();
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.$message.error("扫码错误!");
|
||||
})
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
filters: {},
|
||||
mounted() {
|
||||
}
|
||||
,
|
||||
created() {
|
||||
if(this.idQuery.id!=null){
|
||||
this.filterQuery.upProduct=this.idQuery.parentCode
|
||||
this.isLow=false;
|
||||
this.isUp=true;
|
||||
this.getList();
|
||||
}
|
||||
|
||||
}
|
||||
,
|
||||
}
|
||||
;
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue