Browse Source

5.25

master
fengdong777 2 years ago
parent
commit
1c41fac5b4
  1. 24
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/baseInfo/commodityBrand/index.js
  2. 2
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js
  3. 6
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityBrand/index.vue
  4. 419
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityFily/commodity.vue
  5. 239
      yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityFily/index.vue

24
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/api/baseInfo/commodityBrand/index.js

@ -69,6 +69,30 @@ export default {
}
})
},
// 添加类别
saveList: function(params) {
return request({
url: '/cyf/productType/save ',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
// 修改商品名称
updateShop: function(params) {
return request({
url: '/cyf/productType/update ',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
},
}

2
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/router/index.js

@ -137,7 +137,7 @@ export const constantRoutes = [{
import('@/views/baseInfo/commodityFily/index.vue'),
name: 'index',
meta: {
title: '商品档案'
title: '商品类别'
}
},
]

6
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityBrand/index.vue

@ -7,7 +7,7 @@
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="80px" class="tab-header">
<el-form-item label="类型名称">
<el-form-item label="品牌名称">
<el-input v-model="listQuery.params.name" maxlength="20" placeholder="请输入类型名称" class="addinputw"
clearable />
</el-form-item>
@ -38,8 +38,8 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="类型名称" prop="name" align="center" />
<el-table-column label="类型编号" prop="number" align="center" />
<el-table-column label="品牌名称" prop="name" align="center" />
<el-table-column label="品牌编号" prop="number" align="center" />
</el-table>
</div>
<div class="pages">

419
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityFily/commodity.vue

@ -1,200 +1,257 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>商品品牌</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>商品品牌</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">品牌名称</span>
<el-select v-model="form.name" placeholder="请选择品牌名称" class="item_input" @change="getType">
<el-option v-for="(item,i) in crudeList" :key="i" :label="item.name" :value="item.number" />
</el-select>
</div>
<div class="item">
<span class="item_text">品牌编号</span>
<el-input v-model="form.number" placeholder="" :readonly="true" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">产品名称</span>
<el-select v-model="form.prodSid" placeholder="请选择产品名称" class="item_input" >
<el-option v-for="(item,i) in sidlist" :key="i" :label="item.name" :value="item.prodSid" />
</el-select>
</div>
<div class="item">
<span class="item_text">类别名称</span>
<el-input v-model="form.typeList.name" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
<div class="listconadd">
<el-card class="box-card" >
<div class="item">
<span class="item_text">商品名称</span>
<el-input v-model="form.name" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">名称编号</span>
<el-input v-model="form.number" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">品牌名称</span>
<el-select v-model="form.prodSid" placeholder="" class="item_input" >
<el-option v-for="(item,i) in sidlist" :key="i" :label="item.name" :value="item.sid" />
</el-select>
</div>
<div class="item" >
<span style="font-size: 18px;margin-left: 90px;padding-right: 10px;">添加类别</span>
<el-button @click="caozuo" type="primary">操作</el-button>
</div>
</el-card>
</div>
</template>
<script>
import req from '@/api/baseInfo/commodityBrand/index.js'
export default {
data() {
return {
submitdisabled: false,
crudeList: [],
crudeLists: [],
flowmeterLists: [],
flowmeterList: [],
sidlist: [],
form: {
<el-dialog title="添加商品类别" :visible.sync="entry" width="60%">
<el-form ref="form" :inline="true" :model="form" label-width="80px">
<div v-for="(item, index) in form.typeList" :key="index">
<el-form-item
label="类别名称"
:prop="'typeList.' + index + '.name'"
for="inputID"
>
<el-input id="inputID" v-model="item.name"></el-input>
</el-form-item>
<el-form-item
label="类别编码"
:prop="'typeList.' + index + '.number'"
for="inputIDs"
>
<el-input id="inputIDs" v-model="item.number"></el-input>
</el-form-item>
<el-form-item>
<el-button v-if="index+1 == form.typeList.length" @click="addItem(item,index)" size="small" type="primary">增加</el-button>
<el-button v-if="index !== 0" @click="deleteItem(item, index)" size="small" type="danger">删除</el-button>
</el-form-item>
</div>
<div style="margin-top: 20px;margin-left: 40px; ">
<el-button type="primary" @click="trues()">确定</el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/baseInfo/commodityBrand/index.js'
export default {
data() {
return {
submitdisabled: false,
entry: false,
sidlist: [],
form: {
name: "",
number: "",
prodSid:'',
typeList:[{
name: "",
number: "",
prodSid:'',
typeList:[
{
name:'',
number:''
}
]
},
listQuery: {
current: 1,
size: 100,
params: {
name:''
},
number: ""
}]
},
arry: {
name:'',
number:''
},
listQuery: {
current: 1,
size: 100,
params: {
name:''
},
}
},
created() {
this.getlist()
this.getSid()
},
methods: {
saveOrUpdate() {
// req.save(this.formobj)
// .then(resp => {
// if (resp.success) {
// this.$message({
// showClose: true,
// type: 'success',
// message: resp.msg
// })
// this.handleReturn("true")
// } else {
// // resp.code
// }
// })
// .catch(() => {})
console.log(this.form)
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.form = {
}
},
created() {
this.getlist()
},
methods: {
saveOrUpdate() {
let arrlist=this.form.typeList
let lastlist=arrlist.slice(-1)
if(this.form.name && this.form.number && this.form.prodSid){
if(lastlist[0].name && lastlist[0].number){
req.saveList(this.form)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
this.form= {
name: "",
number: "",
}
this.$emit('doback')
},
getlist(){
req.selectList().then((res)=>{
if (res.success) {
this.crudeLists = res.data
for (var i = 0; i < this.crudeLists.length; i++) {
let item = {
name: this.crudeLists[i].name,
number: this.crudeLists[i].number,
}
this.crudeList.push(item)
prodSid:'',
typeList:[{
name: "",
number: ""
}]
}
}else{
this.$alert('检测到您未输入类别内容,请输入或删除', '提示信息', {
confirmButtonText: '确定',
callback: action => {
this.entry=true
}
})
},
getType(value) {
const choose = this.crudeLists.filter((item) => item.number === value)
this.form.name = choose[0].name
this.form.number = value
console.log(this.form);
},
getSid(){
req.listPages(this.listQuery).then((res)=>{
this.sidlist = res.data.records
})
});
}
}else{
this.$message({
message: '请检查内容是否填写',
type: 'warning'
});
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.$emit('doback')
},
getlist(){
req.selectList().then((res)=>{
if (res.success) {
this.sidlist = res.data
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
})
},
addItem(item) {
if(item.name && item.number){
this.form.typeList.push({
name: "",
number: ""
});
}else{
this.$message({
message: '请输入内容后在添加',
type: 'warning'
});
}
.item_left_input {
width: 20%;
},
sure(form) {
console.log(this.form.typeList.length, "length");
this.$refs[form].validate(valid => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
});
},
deleteItem(item, index) {
this.form.typeList.splice(index, 1);
console.log(this.form.typeList, "删除");
},
caozuo(){
this.entry=true
},
trues(){
this.entry=false
console.log(this.form);
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
</style>
}
</style>

239
yxt-supervise-cyf/yxt-supervise-cyf-ui/src/views/baseInfo/commodityFily/index.vue

@ -36,12 +36,30 @@
>
查看
</el-button>
<el-button
type="primary"
size="mini"
@click="addshop(scope.row)"
>
添加
</el-button>
</template>
</el-table-column>
<el-table-column label="商品品牌" prop="informationName" align="center" />
<el-table-column label="品牌名称" prop="informationName" align="center" />
<el-table-column label="品牌编码" prop="informationNumber" align="center" />
<el-table-column label="商品名称" prop="name" align="center" />
<el-table-column label="名称编号" prop="number" align="center" />
<el-table-column label="操作" align="center" width="150px">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="modifyThe(scope.row)"
>
修改
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
@ -53,22 +71,127 @@
</div>
<oilTankAdd v-show="viewState ==2 || viewState ==3" ref="divAdd" @doback="resetState" @reloadlist="getList" />
<!-- <oilTypeInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" @reloadlist="getList" /> -->
<el-dialog title="查看商品类别" :visible.sync="editDialog" width="40%">
<el-table ref="datalist" :data="datalist" border style="width: 100%">
<el-table-column
property="name"
label="商品类别"
align="center"
></el-table-column>
<el-dialog title="查看商品类别" :visible.sync="editDialog" width="40%">
<el-table ref="datalist" :data="datalist" border style="width: 100%">
<el-table-column
property="name"
label="商品类别"
align="center"
></el-table-column>
<el-table-column
property="number"
label="类别编码"
align="center"
></el-table-column>
<el-table-column label="操作" align="center" width="100px">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="category(scope.row)"
>
修改
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="添加商品类别" :visible.sync="entry" width="40%">
<table class="e-table" cellspacing="0">
<tr>
<td>品牌名称</td>
<td>
<el-input
v-model="shopName"
style="width: 300px"
readonly
></el-input>
</td>
</tr>
<tr>
<td>商品名称</td>
<td>
<el-input
v-model="shopsName"
style="width: 300px"
readonly
></el-input>
</td>
</tr>
<tr>
<td>类别名称</td>
<td>
<el-input v-model="arry.name" style="width: 300px" placeholder="" />
</td>
</tr>
<tr>
<td>类别编码</td>
<td>
<el-input v-model="arry.number" style="width: 300px" placeholder="" />
</td>
</tr>
</table>
<div style="margin-top: 20px;margin-left: 400px; ">
<el-button type="primary" @click="addShop()">保存</el-button>
</div>
</el-dialog>
<el-dialog title="修改商品" :visible.sync="modify" width="40%">
<table class="e-table" cellspacing="0">
<tr>
<td>品牌名称</td>
<td>
<el-input v-model="shopName" style="width: 300px" readonly placeholder="" />
</td>
</tr>
<tr>
<td>品牌编码</td>
<td>
<el-input v-model="shopNum" style="width: 300px" readonly placeholder="" />
</td>
</tr>
<tr>
<td>商品名称</td>
<td>
<el-input
v-model="modifythe.name"
style="width: 300px"
></el-input>
</td>
</tr>
<tr>
<td>名称编号</td>
<td>
<el-input
v-model="modifythe.number"
style="width: 300px"
></el-input>
</td>
</tr>
</table>
<div style="margin-top: 20px;margin-left: 400px; ">
<el-button type="primary" @click="modifyList()">修改</el-button>
</div>
</el-dialog>
<el-dialog title="修改类别" :visible.sync="categorys" width="40%">
<table class="e-table" cellspacing="0">
<tr>
<td>类别名称</td>
<td>
<el-input v-model="modifyArray.name" style="width: 300px" placeholder="" />
</td>
</tr>
<tr>
<td>类别编码</td>
<td>
<el-input v-model="modifyArray.number" style="width: 300px" placeholder="" />
</td>
</tr>
</table>
<div style="margin-top: 20px;margin-left: 400px; ">
<el-button type="primary" @click="modifyCategory()">修改</el-button>
</div>
</el-dialog>
</div>
</template>
@ -94,6 +217,9 @@
listLoading: false,
btndisabled: false,
editDialog: false,
categorys: false,
entry: false,
modify: false,
form: {
name:'',
number:'',
@ -127,7 +253,28 @@
total: 0
},
viewState: 1,
datalist:[]
datalist:[],
forms: {
prodSid:'',
typeList:[]
},
shopName:'',
shopsName:'',
shopNum:'',
arry: {
name:'',
number:''
},
modifythe:{
sid:'',
name:'',
number:''
},
modifyArray:{
sid:'',
name:'',
number:''
}
}
},
mounted() {
@ -212,6 +359,78 @@
this.datalist=res.data
})
},
addshop(row) {
this.entry = true;
this.shopName=row.informationName
this.shopsName=row.name
this.forms.sid=row.sid
},
modifyThe(row) {
this.modify = true;
this.modifythe.sid=row.sid
this.shopName=row.informationName
this.shopNum=row.informationNumber
this.modifythe.name=row.name
this.modifythe.number=row.number
},
category(row) {
this.categorys = true;
this.editDialog = false;
this.modifyArray.sid=row.sid
this.modifyArray = Object.assign({}, row);
},
modifyCategory(){
req.updateShop(this.modifyArray).then((res)=>{
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: res.msg
})
this.categorys = false;
this.getList()
} else {
// resp.code
}
})
.catch(() => {})
},
modifyList(){
req.updateShop(this.modifythe).then((res)=>{
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: res.msg
})
this.modify = false;
this.getList()
} else {
// resp.code
}
})
.catch(() => {})
},
addShop(){
this.forms.typeList.push(this.arry)
req.saveList(this.forms)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.entry = false;
} else {
// resp.code
}
})
.catch(() => {})
this.arry={name:'',number:''}
},
save() {
req.update(this.form)
.then(resp => {

Loading…
Cancel
Save