12 changed files with 1045 additions and 19 deletions
@ -0,0 +1,69 @@ |
|||
import request from '@/utils/request' |
|||
let tokens = window.sessionStorage.getItem('tokenValue') |
|||
export default { |
|||
|
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/cyf/packinventory/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json', |
|||
'token': tokens |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
addInfo: function(data) { |
|||
return request({ |
|||
url: '/cyf/packinventory/save', |
|||
method: 'post', |
|||
data: data |
|||
}); |
|||
}, |
|||
|
|||
packageType: function(params) { |
|||
return request({ |
|||
url: '/cyf/packtype/typeList', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json', |
|||
'token': tokens |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
fetchBySid: function(sid) { |
|||
return request({ |
|||
url: '/cyf/crudeinfo/getCrudeBySid/' + sid |
|||
}) |
|||
}, |
|||
|
|||
updateData: function(data) { |
|||
return request({ |
|||
url: '/cyf/crudeinfo/update', |
|||
method: 'post', |
|||
data: data |
|||
}); |
|||
}, |
|||
|
|||
delBySids: function(sid) { |
|||
return request({ |
|||
url: '/cyf/crudeinfo/delete/' + sid, |
|||
method: 'delete' |
|||
}) |
|||
}, |
|||
|
|||
// 保存每次读取库存
|
|||
saveInfo: function(data) { |
|||
return request({ |
|||
url: '/cyf/crudeinventory/save', |
|||
method: 'post', |
|||
data: data |
|||
}); |
|||
}, |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
let tokens = window.sessionStorage.getItem('tokenValue') |
|||
export default { |
|||
|
|||
// 查询分页列表
|
|||
listPage: function(params) { |
|||
return request({ |
|||
url: '/cyf/packtype/listPage', |
|||
method: 'post', |
|||
data: params, |
|||
headers: { |
|||
'Content-Type': 'application/json', |
|||
'token': tokens |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
addInfo: function(data) { |
|||
return request({ |
|||
url: '/cyf/packtype/save', |
|||
method: 'post', |
|||
data: data |
|||
}); |
|||
}, |
|||
|
|||
fetchBySid: function(sid) { |
|||
return request({ |
|||
url: '/cyf/packtype/getTypeBySid/' + sid |
|||
}) |
|||
}, |
|||
|
|||
updateData: function(data) { |
|||
return request({ |
|||
url: '/cyf/packtype/update', |
|||
method: 'post', |
|||
data: data |
|||
}); |
|||
}, |
|||
|
|||
delBySids: function(sid) { |
|||
return request({ |
|||
url: '/cyf/packtype/delete/' + sid, |
|||
method: 'delete' |
|||
}) |
|||
}, |
|||
|
|||
} |
@ -0,0 +1,262 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState ==1"> |
|||
<button-bar view-title="包装物信息" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<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="100px" class="tab-header"> |
|||
<el-form-item label="包装物名称"> |
|||
<el-input v-model="listQuery.params.name" maxlength="20" placeholder="请输入包装物名称" class="addinputw" |
|||
clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleReset">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleFilter">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">包装物列表</div> |
|||
<!-- 翻页分页 --> |
|||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> --> |
|||
</div> |
|||
<div class=""> |
|||
<el-table v-loading="listLoading" :data="list" border style="width: 100%;"> |
|||
<!-- <el-table-column type="selection" align="center" width="50"/> --> |
|||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" /> |
|||
<el-table-column label="包装物名称" prop="name" align="center" /> |
|||
<el-table-column label="包装物编码" prop="number" align="center" /> |
|||
<el-table-column label="包装物类型" prop="typeName" align="center" /> |
|||
<el-table-column label="包装物初始库存" prop="initialInventory" align="center" /> |
|||
<el-table-column label="包装物现有库存" prop="inventory" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" |
|||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" /> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<packagInfoAdd 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%"> |
|||
<table class="e-table" cellspacing="0"> |
|||
<tr> |
|||
<td>库存数据</td> |
|||
<td> |
|||
<!-- <span>{{form.planContent}}</span> --> |
|||
<el-input v-model="form.existingInventory" style="width: 300px"></el-input> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<div style="margin-top: 20px; text-align: center"> |
|||
<el-button type="primary" @click="save()">保存</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/packagInfo/packagInfo.js' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import packagInfoAdd from './packagInfoAdd.vue' |
|||
// import oilTypeInfo from './oilTypeInfo.vue' |
|||
export default { |
|||
name: 'CustomerManagement', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
packagInfoAdd, |
|||
// oilTypeInfo, |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
listLoading: false, |
|||
btndisabled: false, |
|||
editDialog: false, |
|||
form: {}, |
|||
btnList: [{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
|
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
list: [], |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
name: '', |
|||
}, |
|||
total: 0 |
|||
}, |
|||
viewState: 1 |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
created() { |
|||
this.init() |
|||
// 加载列表 |
|||
}, |
|||
methods: { |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
|
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 初始化 |
|||
init() { |
|||
this.getList() |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.listPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置 |
|||
handleFilter() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
entryName: "" |
|||
} |
|||
} |
|||
this.getList() |
|||
}, |
|||
// 打开添加 |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
}, |
|||
// 打开修改 |
|||
toEdit(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divAdd'].showEdit(row) |
|||
}, |
|||
// 根据本行ID删除数据 |
|||
doDel(row) { |
|||
const tip = '请确认是否删除所选记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
req.delBySids(row.sid).then((response) => { |
|||
if (response.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: '删除成功' |
|||
}) |
|||
this.getList() |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'error', |
|||
message: '删除失败' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
toDetail(row) { |
|||
this.editDialog = true; |
|||
|
|||
this.form.tankSid = row.sid |
|||
}, |
|||
save() { |
|||
console.log("form", this.form) |
|||
|
|||
req.saveInfo(this.form) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
this.editDialog = false; |
|||
this.getList() |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
this.reset(); |
|||
}, |
|||
reset() { |
|||
this.form = {}; |
|||
}, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,190 @@ |
|||
<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> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
|
|||
<div class="listconadd"> |
|||
|
|||
<el-card class="box-card"> |
|||
<div class="item"> |
|||
<span class="item_text">包装物名称:</span> |
|||
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="item_text">包装物编码:</span> |
|||
<el-input v-model="formobj.number" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="item_text">包装物类型:</span> |
|||
<el-select v-model="formobj.typeName" filterable placeholder="请选择包装物类型" class="item_input" @change="getType"> |
|||
<el-option v-for="item in typeList" :key="item.sid" :label="item.name" :value="item.sid" /> |
|||
</el-select> |
|||
<!-- <el-input v-model="formobj.number" placeholder="" class="item_input" clearable /> --> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="item_text">包装物初始库存:</span> |
|||
<el-input v-model="formobj.initialInventory" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
</el-card> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/packagInfo/packagInfo' |
|||
export default { |
|||
data() { |
|||
return { |
|||
submitdisabled: false, |
|||
typeLists: [], |
|||
typeList: [], |
|||
formobj: { |
|||
sid: "", |
|||
name: "", |
|||
number: "", |
|||
inventory: "", |
|||
initialInventory: "", |
|||
typeSid: "", |
|||
typeName: "", |
|||
|
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.packageType() |
|||
}, |
|||
methods: { |
|||
packageType() { |
|||
req.packageType().then((res) => { |
|||
if (res.success) { |
|||
console.log(">>>>>>>>>2222222", res.data) |
|||
this.typeLists = res.data |
|||
for (var i = 0; i < this.typeLists.length; i++) { |
|||
|
|||
let item = { |
|||
name: this.typeLists[i].name, |
|||
sid: this.typeLists[i].sid, |
|||
|
|||
} |
|||
this.typeList.push(item) |
|||
} |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
saveOrUpdate() { |
|||
req.addInfo(this.formobj) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
this.handleReturn("true") |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
|
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: "", |
|||
name: "", |
|||
number: "", |
|||
inventory: "", |
|||
initialInventory: "", |
|||
typeSid: "", |
|||
typeName: "", |
|||
|
|||
} |
|||
this.$emit('doback') |
|||
}, |
|||
getType(value) { |
|||
console.log(">>>>>>>>>getType", value) |
|||
const choose = this.typeLists.filter((item) => item.sid === value) |
|||
console.log(">>>>>>>>>getType", choose[0]) |
|||
this.formobj.typeSid = choose[0].sid |
|||
this.formobj.typeName = choose[0].name |
|||
}, |
|||
} |
|||
} |
|||
</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_list_delect { |
|||
color: #5E94FF; |
|||
margin-left: 20px; |
|||
font-size: 16px; |
|||
text-decoration: underline; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
</style> |
@ -0,0 +1,225 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState ==1"> |
|||
<button-bar view-title="包装物类型" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<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="100px" class="tab-header"> |
|||
<el-form-item label="包装物名称"> |
|||
<el-input v-model="listQuery.params.name" maxlength="20" placeholder="请输入包装物名称" class="addinputw" |
|||
clearable /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleReset">查询</el-button> |
|||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleFilter">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">包装物列表</div> |
|||
<!-- 翻页分页 --> |
|||
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/> --> |
|||
</div> |
|||
<div class=""> |
|||
<el-table v-loading="listLoading" :data="list" border style="width: 100%;"> |
|||
<!-- <el-table-column type="selection" align="center" width="50"/> --> |
|||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" /> |
|||
<el-table-column label="操作" wid align="center" width="180"> |
|||
<template slot-scope="scope"> |
|||
<!-- <el-button type="primary" size="mini" @click="toDetail(scope.row)">查看</el-button> --> |
|||
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button> |
|||
<el-button type="primary" size="mini" @click="doDel(scope.row)">删除</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="包装物Code" prop="code" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" |
|||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<packagTypeAdd v-show="viewState ==2 || viewState ==3" ref="divAdd" @doback="resetState" @reloadlist="getList" /> |
|||
<!-- <oilTypeInfo v-show="viewState ==4" ref="divInfo" @doback="resetState" @reloadlist="getList" /> --> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/packagType/packagType' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import packagTypeAdd from './packagTypeAdd.vue' |
|||
// import oilTypeInfo from './oilTypeInfo.vue' |
|||
export default { |
|||
name: 'CustomerManagement', |
|||
components: { |
|||
Pagination, |
|||
pageye, |
|||
ButtonBar, |
|||
packagTypeAdd, |
|||
// oilTypeInfo, |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
listLoading: false, |
|||
btndisabled: false, |
|||
btnList: [{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
|
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
list: [], |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
params: { |
|||
entryName: '', |
|||
}, |
|||
total: 0 |
|||
}, |
|||
viewState: 1 |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
created() { |
|||
this.init() |
|||
// 加载列表 |
|||
}, |
|||
methods: { |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
|
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 初始化 |
|||
init() { |
|||
this.getList() |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.listPage(this.listQuery).then((response) => { |
|||
this.listLoading = false |
|||
if (response.success) { |
|||
this.list = response.data.records |
|||
this.listQuery.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.listQuery.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleReset() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 重置 |
|||
handleFilter() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
entryName: "" |
|||
} |
|||
} |
|||
this.getList() |
|||
}, |
|||
// 打开添加 |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
}, |
|||
// 打开修改 |
|||
toEdit(row) { |
|||
this.viewState = 3 |
|||
this.$refs['divAdd'].showEdit(row) |
|||
}, |
|||
// 根据本行ID删除数据 |
|||
doDel(row) { |
|||
const tip = '请确认是否删除所选记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
req.delBySids(row.sid).then((response) => { |
|||
if (response.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: '删除成功' |
|||
}) |
|||
this.getList() |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'error', |
|||
message: '删除失败' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
// toDetail(row) { |
|||
// this.viewState = 4 |
|||
// this.$refs['divInfo'].showAdd(row.sid) |
|||
// }, |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
</style> |
@ -0,0 +1,194 @@ |
|||
<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> |
|||
<!-- end 添加修改按钮 --> |
|||
<!-- end 详情按钮 --> |
|||
</div> |
|||
|
|||
<div class="listconadd"> |
|||
|
|||
<el-card class="box-card"> |
|||
<!-- <div class="item"> |
|||
<span class="item_text">包装物/包装物:</span> |
|||
<div class="item_input"> |
|||
<el-radio v-model="radio" label="1">包装物</el-radio> |
|||
<el-radio v-model="radio" label="2">包装物</el-radio> |
|||
</div> |
|||
</div> --> |
|||
<div class="item"> |
|||
<span class="item_text">包装物类型:</span> |
|||
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="item_text">包装物编码:</span> |
|||
<el-input v-model="formobj.number" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
<div class="item"> |
|||
<span class="item_text">包装物Code:</span> |
|||
<el-input v-model="formobj.code" placeholder="" class="item_input" clearable /> |
|||
</div> |
|||
</el-card> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import req from '@/api/packagType/packagType' |
|||
export default { |
|||
data() { |
|||
return { |
|||
submitdisabled: false, |
|||
radio:"1", |
|||
formobj: { |
|||
sid: "", |
|||
type:"", |
|||
name: "", |
|||
number: "", |
|||
code: "" |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
saveOrUpdate() { |
|||
|
|||
console.log("radio》》》》》》》",this.radio) |
|||
|
|||
this.formobj.type = this.radio |
|||
|
|||
|
|||
if(this.formobj.sid){ |
|||
req.updateData(this.formobj) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
this.handleReturn("true") |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
}else{ |
|||
req.addInfo(this.formobj) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.$message({ |
|||
showClose: true, |
|||
type: 'success', |
|||
message: resp.msg |
|||
}) |
|||
this.handleReturn("true") |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
} |
|||
}) |
|||
.catch(() => {}) |
|||
} |
|||
|
|||
}, |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.formobj = { |
|||
sid: "", |
|||
name: "", |
|||
number: "", |
|||
code: "" |
|||
} |
|||
this.$emit('doback') |
|||
}, |
|||
|
|||
showAdd() { |
|||
|
|||
}, |
|||
showEdit(row) { |
|||
console.log("sid>>>>>>>>>",row.sid) |
|||
req.fetchBySid(row.sid) |
|||
.then(resp => { |
|||
if (resp.success) { |
|||
this.formobj = resp.data |
|||
} |
|||
|
|||
}) |
|||
.catch(e => { |
|||
this.formobj = row |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</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_list_delect { |
|||
color: #5E94FF; |
|||
margin-left: 20px; |
|||
font-size: 16px; |
|||
text-decoration: underline; |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
</style> |
Loading…
Reference in new issue