新建项目
This commit is contained in:
252
src/views/404.vue
Normal file
252
src/views/404.vue
Normal file
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<div class="wscn-http404-container">
|
||||
<div class="wscn-http404">
|
||||
<div class="pic-404">
|
||||
<img
|
||||
class="pic-404__parent"
|
||||
src="@/assets/404_images/404.png"
|
||||
alt="404"
|
||||
/>
|
||||
<img
|
||||
class="pic-404__child left"
|
||||
src="@/assets/404_images/404_cloud.png"
|
||||
alt="404"
|
||||
/>
|
||||
<img
|
||||
class="pic-404__child mid"
|
||||
src="@/assets/404_images/404_cloud.png"
|
||||
alt="404"
|
||||
/>
|
||||
<img
|
||||
class="pic-404__child right"
|
||||
src="@/assets/404_images/404_cloud.png"
|
||||
alt="404"
|
||||
/>
|
||||
</div>
|
||||
<div class="bullshit">
|
||||
<div class="bullshit__oops">OOPS!</div>
|
||||
<div class="bullshit__info">
|
||||
All rights reserved
|
||||
<a
|
||||
style="color: #20a0ff"
|
||||
href="https://wallstreetcn.com"
|
||||
target="_blank"
|
||||
>wallstreetcn</a
|
||||
>
|
||||
</div>
|
||||
<div class="bullshit__headline">{{ message }}</div>
|
||||
<div class="bullshit__info">
|
||||
Please check that the URL you entered is correct, or click the button
|
||||
below to return to the homepage.
|
||||
</div>
|
||||
<a href="" class="bullshit__return-home">Back to home</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Page404",
|
||||
computed: {
|
||||
message() {
|
||||
return "The webmaster said that you can not enter this page...";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wscn-http404-container {
|
||||
transform: translate(-50%, -50%);
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
}
|
||||
.wscn-http404 {
|
||||
position: relative;
|
||||
width: 1200px;
|
||||
padding: 0 50px;
|
||||
overflow: hidden;
|
||||
.pic-404 {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 600px;
|
||||
overflow: hidden;
|
||||
&__parent {
|
||||
width: 100%;
|
||||
}
|
||||
&__child {
|
||||
position: absolute;
|
||||
&.left {
|
||||
width: 80px;
|
||||
top: 17px;
|
||||
left: 220px;
|
||||
opacity: 0;
|
||||
animation-name: cloudLeft;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
&.mid {
|
||||
width: 46px;
|
||||
top: 10px;
|
||||
left: 420px;
|
||||
opacity: 0;
|
||||
animation-name: cloudMid;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1.2s;
|
||||
}
|
||||
&.right {
|
||||
width: 62px;
|
||||
top: 100px;
|
||||
left: 500px;
|
||||
opacity: 0;
|
||||
animation-name: cloudRight;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
@keyframes cloudLeft {
|
||||
0% {
|
||||
top: 17px;
|
||||
left: 220px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 33px;
|
||||
left: 188px;
|
||||
opacity: 1;
|
||||
}
|
||||
80% {
|
||||
top: 81px;
|
||||
left: 92px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 97px;
|
||||
left: 60px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes cloudMid {
|
||||
0% {
|
||||
top: 10px;
|
||||
left: 420px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 40px;
|
||||
left: 360px;
|
||||
opacity: 1;
|
||||
}
|
||||
70% {
|
||||
top: 130px;
|
||||
left: 180px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 160px;
|
||||
left: 120px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes cloudRight {
|
||||
0% {
|
||||
top: 100px;
|
||||
left: 500px;
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
top: 120px;
|
||||
left: 460px;
|
||||
opacity: 1;
|
||||
}
|
||||
80% {
|
||||
top: 180px;
|
||||
left: 340px;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
top: 200px;
|
||||
left: 300px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bullshit {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 300px;
|
||||
padding: 30px 0;
|
||||
overflow: hidden;
|
||||
&__oops {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
line-height: 40px;
|
||||
color: #1482f0;
|
||||
opacity: 0;
|
||||
margin-bottom: 20px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__headline {
|
||||
font-size: 20px;
|
||||
line-height: 24px;
|
||||
color: #222;
|
||||
font-weight: bold;
|
||||
opacity: 0;
|
||||
margin-bottom: 10px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.1s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__info {
|
||||
font-size: 13px;
|
||||
line-height: 21px;
|
||||
color: grey;
|
||||
opacity: 0;
|
||||
margin-bottom: 30px;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.2s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
&__return-home {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 110px;
|
||||
height: 36px;
|
||||
background: #1482f0;
|
||||
border-radius: 100px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
opacity: 0;
|
||||
font-size: 14px;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
animation-name: slideUp;
|
||||
animation-duration: 0.5s;
|
||||
animation-delay: 0.3s;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
@keyframes slideUp {
|
||||
0% {
|
||||
transform: translateY(60px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
174
src/views/baseInfo/supplier/supplier/relation/openingbank.vue
Normal file
174
src/views/baseInfo/supplier/supplier/relation/openingbank.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="saveOrUpdate()">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>开户银行</div>
|
||||
<el-form-item prop="bankName"><el-input class="addinputInfo addinputw" v-model="formobj.bankName" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>银行账号</div>
|
||||
<el-form-item prop="bankAccount"><el-input class="addinputInfo addinputw" v-model="formobj.bankAccount" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>账号名称</div>
|
||||
<el-form-item prop="accountName"><el-input class="addinputInfo addinputw" v-model="formobj.accountName" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>账号类型</div>
|
||||
<el-form-item prop="dueBankKey">
|
||||
<el-select v-model="formobj.dueBankKey" class="addinputInfo" placeholder="" @change="dueBankChange">
|
||||
<el-option v-for="item in dueBank_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">开户行地址</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.bankAddress" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">银行网点</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.bankingOutlets" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">联行号</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.paymentLines" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">swiftCode(银行代码)</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.swiftCode" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">币种</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.currency" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { typeValues } from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'OpeningBank',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
dueBank_list: [],
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierSid: '',
|
||||
bankName: '',
|
||||
bankAccount: '',
|
||||
accountName: '',
|
||||
dueBankKey: '',
|
||||
dueBankValue: '',
|
||||
bankingOutlets: '',
|
||||
bankAddress: '',
|
||||
paymentLines: '',
|
||||
swiftCode: '',
|
||||
currency: ''
|
||||
},
|
||||
index: '',
|
||||
rules: {
|
||||
bankName: [{ required: true, message: '开户银行不能为空', trigger: 'blur' }],
|
||||
bankAccount: [{ required: true, message: '银行账号不能为空', trigger: 'blur' }],
|
||||
accountName: [{ required: true, message: '账号名称不能为空', trigger: 'blur' }],
|
||||
dueBankKey: [{ required: true, message: '账号类型不能为空', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
typeValues({ type: 'dueBank' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.dueBank_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】开户行信息'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
showEdit(value, index) {
|
||||
this.viewTitle = '【编辑】开户行信息'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
this.formobj = JSON.parse(JSON.stringify(value))
|
||||
this.index = index
|
||||
},
|
||||
dueBankChange(value) {
|
||||
const choose = this.dueBank_list.filter((item) => item.dictKey === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.dueBankValue = choose[0].dictValue
|
||||
} else {
|
||||
this.formobj.dueBankValue = ''
|
||||
}
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('backData', this.formobj, this.index)
|
||||
this.handleReturn()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierSid: '',
|
||||
bankName: '',
|
||||
bankAccount: '',
|
||||
accountName: '',
|
||||
dueBankKey: '',
|
||||
dueBankValue: '',
|
||||
bankingOutlets: '',
|
||||
bankAddress: '',
|
||||
paymentLines: '',
|
||||
swiftCode: '',
|
||||
currency: ''
|
||||
}
|
||||
this.index = ''
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 140px !important;
|
||||
}
|
||||
.addinputInfo {
|
||||
margin-left: 130px !important;
|
||||
}
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
</style>
|
||||
270
src/views/baseInfo/supplier/supplier/supplier.vue
Normal file
270
src/views/baseInfo/supplier/supplier/supplier.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="供应商管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<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.supplierName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类">
|
||||
<el-input v-model="listQuery.params.supplierTypeName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="办公电话">
|
||||
<el-input v-model="listQuery.params.contactTelePhone" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="listQuery.params.contactName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<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>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<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="操作" width="180px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierName" label="厂商名称" align="center" />
|
||||
<el-table-column prop="supplierTypeName" label="厂商分类" align="center" />
|
||||
<el-table-column prop="address" label="厂商通讯地址" align="center" />
|
||||
<el-table-column prop="contactTelePhone" label="厂商办公电话" align="center" />
|
||||
<el-table-column prop="contactName" label="联系人" align="center" />
|
||||
<el-table-column prop="contactMobile" label="联系电话" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<!--新增及修改 -->
|
||||
<supplierAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList" />
|
||||
<!-- 详情 -->
|
||||
<supplierInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
import supplierAdd from './supplierAdd'
|
||||
import supplierInfo from './supplierInfo'
|
||||
|
||||
export default {
|
||||
name: 'Supplier',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar,
|
||||
supplierAdd,
|
||||
supplierInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierName: '',
|
||||
supplierTypeName: '',
|
||||
contactTelePhone: '',
|
||||
contactName: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierName: '',
|
||||
supplierTypeName: '',
|
||||
contactTelePhone: '',
|
||||
contactName: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divAdd'].showAdd()
|
||||
},
|
||||
toEdit(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divAdd'].showEdit(row)
|
||||
},
|
||||
toInfo(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divInfo'].showInfo(row)
|
||||
},
|
||||
doDel() {
|
||||
if (this.sids.length === 0) {
|
||||
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
|
||||
return
|
||||
}
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.delBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({ type: 'success', message: resp.msg, showClose: true })
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 修改、编辑、详情返回列表页面
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
475
src/views/baseInfo/supplier/supplier/supplierAdd.vue
Normal file
475
src/views/baseInfo/supplier/supplier/supplierAdd.vue
Normal file
@@ -0,0 +1,475 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<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="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">基本信息</div>
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商名称</div>
|
||||
<el-form-item prop="supplierName"><el-input class="addinputInfo addinputw" v-model="formobj.supplierName" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商简称</div>
|
||||
<el-form-item prop="supplierPY"><el-input class="addinputInfo addinputw" v-model="formobj.supplierPY" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商编码</div>
|
||||
<el-form-item prop="supplierCode"><el-input class="addinputInfo addinputw" v-model="formobj.supplierCode" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商类型</div>
|
||||
<el-form-item prop="supplierTypeSid">
|
||||
<el-select class="addinputInfo" v-model="formobj.supplierTypeSid" filterable placeholder="" @change="supplierTypeChange">
|
||||
<el-option v-for="item in supplierType_list" :key="item.sid" :label="item.supplierTypeName" :value="item.sid"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商电话</div>
|
||||
<el-form-item prop="contactTelePhone"><el-input class="addinputInfo addinputw" v-model="formobj.contactTelePhone" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">传真</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.fax" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">详细地址</div>
|
||||
<el-form-item>
|
||||
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center">
|
||||
<el-select v-model="formobj.province" filterable clearable placeholder="请选择省" style="width:160px" @change="provinceChange">
|
||||
<el-option v-for="item in province_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||
</el-select>
|
||||
<el-select v-model="formobj.city" filterable placeholder="请选择市" style="width:160px" @change="cityChange">
|
||||
<el-option v-for="item in city_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||
</el-select>
|
||||
<el-select v-model="formobj.county" filterable placeholder="请选择县" style="width:160px" @change="countyChange">
|
||||
<el-option v-for="item in county_list" :key="item.sid" :label="item.name" :value="item.name"/>
|
||||
</el-select>
|
||||
<el-input style="width: 30%" v-model="formobj.address" clearable placeholder=""/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系人</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.contactName" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系电话</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.contactMobile" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">邮编</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.zipCode" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">电子邮件</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.email" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">网址</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.website" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>开票公司名称</div>
|
||||
<el-form-item prop="billingCompanyName"><el-input class="addinputInfo addinputw" v-model="formobj.billingCompanyName" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税号</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.registNum" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">法人</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.legalName" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购员</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.purchaser" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>开票类型</div>
|
||||
<el-form-item prop="billingTypeValue">
|
||||
<el-select class="addinputInfo" v-model="formobj.billingTypeValue" filterable placeholder="" @change="billingTypeChange">
|
||||
<el-option v-for="item in billingType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>税率</div>
|
||||
<el-form-item prop="taxRate"><el-input class="addinputInfo addinputw" @keyup.native="formobj.taxRate = getNumber(formobj.taxRate, 2)" v-model="formobj.taxRate" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.remarks" clearable placeholder=""/></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="title titleOne">
|
||||
<div>开户行列表</div>
|
||||
<el-button type="primary" size="mini" class="btntopblueline" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table :key="tableKey" :data="formobj.baseSupplierBankList" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center"/>
|
||||
<el-table-column fixed width="150" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row, scope.$index)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="handleDelete(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dueBankValue" label="账户类型" align="center" width="100" />
|
||||
<el-table-column prop="bankName" label="开户银行" align="center" width="120"/>
|
||||
<el-table-column prop="bankAccount" label="银行账号" align="center" width="100" />
|
||||
<el-table-column prop="accountName" label="账号名称" align="center" width="160" />
|
||||
<el-table-column prop="bankingOutlets" label="银行网点" align="center" width="100" />
|
||||
<el-table-column prop="bankAddress" label="开户行地址" align="center" min-width="200"/>
|
||||
<el-table-column prop="paymentLines" label="联行号" align="center" width="100"/>
|
||||
<el-table-column prop="swiftCode" label="swifcode(银行代码)" align="center" width="170" />
|
||||
<el-table-column prop="currency" label="币种" align="center" width="100"/>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<openingbank v-show="viewState == 2 || viewState == 3" ref="divOpen" @backData="backData" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
import openingbank from './relation/openingbank'
|
||||
import { getProvince, getCity, getCounty, typeValues } from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'SupplierAdd',
|
||||
components: {
|
||||
openingbank
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
submitdisabled: false,
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
supplierType_list: [],
|
||||
province_list: [],
|
||||
city_list: [],
|
||||
county_list: [],
|
||||
billingType_list: [],
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: []
|
||||
},
|
||||
rules: {
|
||||
supplierName: [{ required: true, message: '供应商名称不能为空', trigger: 'blur' }],
|
||||
supplierPY: [{ required: true, message: '供应商简称不能为空', trigger: 'blur' }],
|
||||
supplierCode: [{ required: true, message: '供应商编码不能为空', trigger: 'blur' }],
|
||||
supplierTypeSid: [{ required: true, message: '供应商类型不能为空', trigger: 'change' }],
|
||||
contactTelePhone: [{ required: true, message: '供应商电话不能为空', trigger: 'blur' }],
|
||||
billingCompanyName: [{ required: true, message: '开票公司名称不能为空', trigger: 'blur' }],
|
||||
billingTypeValue: [{ required: true, message: '开票类型不能为空', trigger: 'change' }],
|
||||
taxRate: [{ required: true, message: '税率不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
typeValues({ type: 'accountType' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.billingType_list = res.data
|
||||
}
|
||||
})
|
||||
getProvince().then((res) => {
|
||||
if (res.success) {
|
||||
this.province_list = res.data
|
||||
}
|
||||
})
|
||||
req.selSupplierType({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
|
||||
if (res.success) {
|
||||
this.supplierType_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getNumber(val, limit) {
|
||||
val = val.replace(/[^0-9.]/g, '') // 保留数字
|
||||
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
||||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0.
|
||||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个
|
||||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点
|
||||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0
|
||||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
|
||||
const reg = new RegExp(str)
|
||||
if (limit === 0) {
|
||||
// 不需要小数点
|
||||
val = val.replace(reg, '$1')
|
||||
} else {
|
||||
// 通过正则保留小数点后指定的位数
|
||||
val = val.replace(reg, '$1.$2')
|
||||
}
|
||||
return val
|
||||
},
|
||||
supplierTypeChange(value) {
|
||||
const choose = this.supplierType_list.filter((item) => item.sid === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.supplierTypeName = choose[0].supplierTypeName
|
||||
}
|
||||
},
|
||||
provinceChange(value) {
|
||||
const choose = this.province_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.provinceSid = choose[0].sid
|
||||
this.getCity(this.formobj.provinceSid)
|
||||
} else {
|
||||
this.formobj.provinceSid = ''
|
||||
this.formobj.citySid = ''
|
||||
this.formobj.city = ''
|
||||
this.city_list = []
|
||||
this.formobj.county = ''
|
||||
this.formobj.countySid = ''
|
||||
this.county_list = []
|
||||
}
|
||||
},
|
||||
getCity(val) {
|
||||
getCity({ sid: val }).then((res) => {
|
||||
if (res.success) {
|
||||
this.city_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
cityChange(value) {
|
||||
const choose = this.city_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.citySid = choose[0].sid
|
||||
this.getCounty(this.formobj.citySid)
|
||||
}
|
||||
},
|
||||
getCounty(val) {
|
||||
getCounty({ sid: val }).then((res) => {
|
||||
if (res.success) {
|
||||
this.county_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
countyChange(value) {
|
||||
const choose = this.county_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.countySid = choose[0].sid
|
||||
}
|
||||
},
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】供应商'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
showEdit(row) {
|
||||
this.viewTitle = '【编辑】供应商'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
req.fetchDetailsBySid(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
billingTypeChange(value) {
|
||||
const choose = this.billingType_list.filter((item) => item.dictValue === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.billingTypeKey = choose[0].dictKey
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divOpen'].showAdd()
|
||||
},
|
||||
handleEdit(row, index) {
|
||||
this.viewState = 3
|
||||
this.$refs['divOpen'].showEdit(row, index)
|
||||
},
|
||||
handleDelete(index) {
|
||||
this.formobj.baseSupplierBankList.splice(index, 1)
|
||||
},
|
||||
backData(value, index) {
|
||||
this.viewState = 1
|
||||
value = JSON.parse(JSON.stringify(value))
|
||||
if (index !== '' && index !== null) {
|
||||
this.formobj.baseSupplierBankList[index] = {
|
||||
sid: value.sid,
|
||||
supplierSid: value.supplierSid,
|
||||
bankName: value.bankName,
|
||||
bankAccount: value.bankAccount,
|
||||
accountName: value.accountName,
|
||||
dueBankKey: value.dueBankKey,
|
||||
dueBankValue: value.dueBankValue,
|
||||
bankingOutlets: value.bankingOutlets,
|
||||
bankAddress: value.bankAddress,
|
||||
paymentLines: value.paymentLines,
|
||||
swiftCode: value.swiftCode,
|
||||
currency: value.currency
|
||||
}
|
||||
} else {
|
||||
this.formobj.baseSupplierBankList.push({
|
||||
sid: '',
|
||||
supplierSid: value.supplierSid,
|
||||
bankName: value.bankName,
|
||||
bankAccount: value.bankAccount,
|
||||
accountName: value.accountName,
|
||||
dueBankKey: value.dueBankKey,
|
||||
dueBankValue: value.dueBankValue,
|
||||
bankingOutlets: value.bankingOutlets,
|
||||
bankAddress: value.bankAddress,
|
||||
paymentLines: value.paymentLines,
|
||||
swiftCode: value.swiftCode,
|
||||
currency: value.currency
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.saveOrUpdate(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: []
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/*表格列设置fixed后固定列出现下边框的设置*/
|
||||
/deep/ .el-table__fixed {
|
||||
height: 100% !important;
|
||||
}
|
||||
/*表格列设置fixed后固定列出现下边框的设置*/
|
||||
/deep/ .el-table__fixed-right {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
236
src/views/baseInfo/supplier/supplier/supplierInfo.vue
Normal file
236
src/views/baseInfo/supplier/supplier/supplierInfo.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">基本信息</div>
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商名称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商简称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierPY }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商编码</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierCode }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierTypeName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商电话</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactTelePhone }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商传真</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.fax }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">详细地址</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.province }}{{ formobj.city }}{{ formobj.county }}{{ formobj.address }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系电话</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactMobile }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">邮编</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.zipCode }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">电子邮件</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.email }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">网址</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.website }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">开票公司名称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billingCompanyName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.registNum }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">法人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.legalName }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购员</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.purchaser }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">开票类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billingTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税率</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.taxRate }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="title">开户行列表</div>
|
||||
<el-table :key="tableKey" :data="formobj.pmsSupplierBankList" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center"/>
|
||||
<el-table-column prop="dueBankValue" label="账户类型" align="center" width="100" />
|
||||
<el-table-column prop="bankName" label="开户银行" align="center" width="120"/>
|
||||
<el-table-column prop="bankAccount" label="银行账号" align="center" width="100" />
|
||||
<el-table-column prop="accountName" label="账号名称" align="center" width="160" />
|
||||
<el-table-column prop="bankingOutlets" label="银行网点" align="center" width="100" />
|
||||
<el-table-column prop="bankAddress" label="开户行地址" align="center" min-width="200"/>
|
||||
<el-table-column prop="paymentLines" label="联行号" align="center" width="100"/>
|
||||
<el-table-column prop="swiftCode" label="swifcode(银行代码)" align="center" width="170" />
|
||||
<el-table-column prop="currency" label="币种" align="center" width="100"/>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
|
||||
export default {
|
||||
name: 'SupplierInfo',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
pmsSupplierBankList: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showInfo(row) {
|
||||
this.viewTitle = '供应商详情'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.fetchDetailsBySid(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
pmsSupplierBankList: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
</style>
|
||||
296
src/views/baseInfo/supplier/suppliertype/suppliertype.vue
Normal file
296
src/views/baseInfo/supplier/suppliertype/suppliertype.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="供应商类型管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<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.supplierTypeName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="listQuery.params.supplierTypeCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<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>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<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="操作" width="180px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierTypeName" label="供应商类型" align="center" />
|
||||
<el-table-column prop="supplierTypeCode" label="供应商编码" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogVisible" width="70%">
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<el-row style="border-top: 1px solid #E0E3EB">
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商类型</div>
|
||||
<el-form-item><el-input class="addinputInfo" style="width: 60%" v-model.trim="formobj.supplierTypeName" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商编码</div>
|
||||
<el-form-item><el-input class="addinputInfo" style="width: 60%" v-model.trim="formobj.supplierTypeCode" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/baseinfo/suppliertype/suppliertype.js'
|
||||
export default {
|
||||
name: 'SupplierType',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
dialogVisible: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
},
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toAdd() {
|
||||
this.dialogVisible = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
},
|
||||
toEdit(row) {
|
||||
this.dialogVisible = true
|
||||
this.formobj = {
|
||||
sid: row.sid,
|
||||
supplierTypeName: row.supplierTypeName,
|
||||
supplierTypeCode: row.supplierTypeCode,
|
||||
orgPath: ''
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.formobj.supplierTypeName === '' || this.formobj.supplierTypeCode === '') {
|
||||
this.$message({ showClose: true, type: 'error', message: '供应商类型或编码不能为空' })
|
||||
return
|
||||
}
|
||||
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
req.saveOrUpdate(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.dialogVisible = false
|
||||
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
doDel() {
|
||||
if (this.sids.length === 0) {
|
||||
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
|
||||
return
|
||||
}
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.delBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({ type: 'success', message: resp.msg, showClose: true })
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 100px !important;
|
||||
}
|
||||
.addinputInfo {
|
||||
margin-left: 90px !important;
|
||||
}
|
||||
</style>
|
||||
232
src/views/baseInfo/warehouses/goodsShelves/goodsShelvesAdd.vue
Normal file
232
src/views/baseInfo/warehouses/goodsShelves/goodsShelvesAdd.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<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-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
|
||||
@change="selectWarehouseChange">
|
||||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">选择所属库区:</span>
|
||||
<el-select v-model="formobj.locationName" placeholder="请选择所属库区" class="item_input"
|
||||
@change="selectWarehouseAreaChange">
|
||||
<el-option v-for="item in warehouseAreaList" :key="item.sid" :label="item.areaName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库位名称:</span>
|
||||
<el-input v-model="formobj.rackName" placeholder="库位名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库位编码:</span>
|
||||
<el-input v-model="formobj.rackCode" placeholder="库位编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库位备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库位备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/goodsShelves/goodsShelves.js'
|
||||
import req2 from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import req3 from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
rackName: '',
|
||||
rackCode: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
locationName: '',
|
||||
locationSid: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
},
|
||||
warehouseList: [],
|
||||
warehouseAreaList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
req2.getAllWarehouse(parpams).then(resp => {
|
||||
this.warehouseList = resp.data
|
||||
})
|
||||
|
||||
req3.getAllWarehousearea(parpams).then(resp => {
|
||||
this.warehouseAreaList = resp.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
req.saveGoodsShelves(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: '',
|
||||
rackName: '',
|
||||
rackCode: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
locationName: '',
|
||||
locationSid: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initGoodsShelves(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectWarehouseChange(val) {
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseChange', choose)
|
||||
this.formobj.warehouseSid = choose[0].sid
|
||||
this.formobj.warehouseName = choose[0].warehouseName
|
||||
},
|
||||
selectWarehouseAreaChange(val) {
|
||||
const choose = this.warehouseAreaList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaChange', choose)
|
||||
this.formobj.locationSid = choose[0].sid
|
||||
this.formobj.locationName = choose[0].areaName
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
262
src/views/baseInfo/warehouses/goodsShelves/index.vue
Normal file
262
src/views/baseInfo/warehouses/goodsShelves/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库位列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="库位名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
@click="dosearch"
|
||||
>查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库位列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
|
||||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rackName" label="库位名称" align="center" />
|
||||
<el-table-column prop="rackCode" label="库位编码" align="center" />
|
||||
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
|
||||
<el-table-column prop="locationName" label="所属库区" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination
|
||||
v-show="dataList.length > 0"
|
||||
:total="queryParams.total"
|
||||
:page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size"
|
||||
class="pagination"
|
||||
@pagination="loadList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/goodsShelves/goodsShelves.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './goodsShelvesAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
268
src/views/baseInfo/warehouses/warehouse/index.vue
Normal file
268
src/views/baseInfo/warehouses/warehouse/index.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="仓库列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="仓库名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
@click="dosearch"
|
||||
>查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">仓库列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
|
||||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" :active-value="1"
|
||||
:inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseName" label="仓库名称" align="center" />
|
||||
<el-table-column prop="warehouseCode" label="仓库编码" align="center" />
|
||||
<el-table-column prop="manager" label="仓库主管" align="center" />
|
||||
<el-table-column prop="telephone" label="联系电话" align="center" />
|
||||
<el-table-column prop="squareMeter" label="占地面积" align="center" />
|
||||
<el-table-column prop="address" label="仓库地址" align="center" />
|
||||
<el-table-column prop="sortNo" label="排序" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination
|
||||
v-show="dataList.length > 0"
|
||||
:total="queryParams.total"
|
||||
:page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size"
|
||||
class="pagination"
|
||||
@pagination="loadList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
248
src/views/baseInfo/warehouses/warehouse/warehouseAdd.vue
Normal file
248
src/views/baseInfo/warehouses/warehouse/warehouseAdd.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<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.warehouseName" placeholder="仓库名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库编码:</span>
|
||||
<el-input v-model="formobj.warehouseCode" placeholder="仓库编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库联系人:</span>
|
||||
<el-input v-model="formobj.contacts" placeholder="仓库联系人" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">手机号码:</span>
|
||||
<el-input v-model="formobj.mob" placeholder="手机号码" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库主管:</span>
|
||||
<el-input v-model="formobj.manager" placeholder="仓库主管" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">联系电话:</span>
|
||||
<el-input v-model="formobj.telephone" placeholder="联系电话" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item_text">占地面积:</span>
|
||||
<el-input v-model="formobj.squareMeter" placeholder="占地面积" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库经度:</span>
|
||||
<el-input v-model="formobj.longitude" placeholder="仓库经度" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库纬度:</span>
|
||||
<el-input v-model="formobj.latitude" placeholder="仓库纬度" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">具体地址:</span>
|
||||
<el-input v-model="formobj.address" placeholder="具体地址" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">使用状态:</span>
|
||||
<el-radio-group v-model="formobj.usageStatus" size="small" @change="changeTheme" class="item_input">
|
||||
<el-radio :label="1">正常</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <el-input v-model="formobj.usageStatus" placeholder="仓库排序" class="item_input" clearable /> -->
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="仓库排序" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="具体地址" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
warehouseName: '',
|
||||
warehouseCode: '',
|
||||
contacts: "",
|
||||
mob: "",
|
||||
telephone: "",
|
||||
manager: '',
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
usageStatus: "",
|
||||
address: '',
|
||||
squareMeter: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
warehouseType: "0",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeTheme(val) {
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
req.saveWarehouse(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: '',
|
||||
warehouseName: '',
|
||||
warehouseCode: '',
|
||||
contacts: "",
|
||||
mob: "",
|
||||
telephone: "",
|
||||
manager: '',
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
usageStatus: "",
|
||||
address: '',
|
||||
squareMeter: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
warehouseType: "0",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initWarehouse(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
267
src/views/baseInfo/warehouses/warehouseArea/index.vue
Normal file
267
src/views/baseInfo/warehouses/warehouseArea/index.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库区列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="库区名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
@click="dosearch"
|
||||
>查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库区列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
|
||||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="areaName" label="库区名称" align="center" />
|
||||
<el-table-column prop="areaCode" label="库区编码" align="center" />
|
||||
<el-table-column prop="volume" label="库区容量" align="center" />
|
||||
<el-table-column prop="unit" label="计量单位" align="center" />
|
||||
<el-table-column prop="areaTypeName" label="库区类型" align="center" />
|
||||
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination
|
||||
v-show="dataList.length > 0"
|
||||
:total="queryParams.total"
|
||||
:page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size"
|
||||
class="pagination"
|
||||
@pagination="loadList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAreaAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
245
src/views/baseInfo/warehouses/warehouseArea/warehouseAreaAdd.vue
Normal file
245
src/views/baseInfo/warehouses/warehouseArea/warehouseAreaAdd.vue
Normal file
@@ -0,0 +1,245 @@
|
||||
<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-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
|
||||
@change="selectWarehouseChange">
|
||||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区名称:</span>
|
||||
<el-input v-model="formobj.areaName" placeholder="库区名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区编码:</span>
|
||||
<el-input v-model="formobj.areaCode" placeholder="库区编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区容量:</span>
|
||||
<el-input v-model="formobj.volume" placeholder="库区容量" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">计量单位:</span>
|
||||
<el-input v-model="formobj.unit" placeholder="计量单位" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区类型:</span>
|
||||
<el-select v-model="formobj.areaTypeName" placeholder="请选择库区类型" class="item_input"
|
||||
@change="selectWarehouseTypeValueChange">
|
||||
<el-option v-for="item in warehouseTypeList" :key="item.sid" :label="item.warehouseAreaTypeName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库区备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
import req2 from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import req3 from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
areaName: '',
|
||||
areaCode: '',
|
||||
volume: '',
|
||||
unit: '',
|
||||
remarks: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
areaTypeSid: "",
|
||||
areaTypeName: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
},
|
||||
warehouseList: [],
|
||||
warehouseTypeList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
req2.getAllWarehouse(parpams).then(resp => {
|
||||
this.warehouseList = resp.data
|
||||
})
|
||||
|
||||
req3.getAllWarehouseareatype(parpams).then(resp => {
|
||||
this.warehouseTypeList = resp.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
req.saveWarehousearea(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: '',
|
||||
areaName: '',
|
||||
areaCode: '',
|
||||
volume: '',
|
||||
unit: '',
|
||||
remarks: '',
|
||||
areaTypeSid: "",
|
||||
areaTypeName: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initWarehousearea(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectWarehouseChange(val) {
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseChange', choose)
|
||||
this.formobj.warehouseSid = choose[0].sid
|
||||
this.formobj.warehouseName = choose[0].warehouseName
|
||||
},
|
||||
selectWarehouseTypeValueChange(val) {
|
||||
const choose = this.warehouseTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseTypeValueChange', choose)
|
||||
this.formobj.areaTypeSid = choose[0].sid
|
||||
this.formobj.areaTypeName = choose[0].warehouseAreaTypeName
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
264
src/views/baseInfo/warehouses/warehouseAreaType/index.vue
Normal file
264
src/views/baseInfo/warehouses/warehouseAreaType/index.vue
Normal file
@@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库区类型列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="库区类型名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
@click="dosearch"
|
||||
>查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库区类型列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
|
||||
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseAreaTypeName" label="库区类型名称" align="center" />
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" />
|
||||
<el-table-column prop="remarks" label="库区类型备注" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination
|
||||
v-show="dataList.length > 0"
|
||||
:total="queryParams.total"
|
||||
:page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size"
|
||||
class="pagination"
|
||||
@pagination="loadList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAreaTypeAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<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.warehouseAreaTypeName" placeholder="库区类型名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区类型备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库区类型备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
warehouseAreaTypeName: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
req.saveWarehousearea(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: '',
|
||||
warehouseAreaTypeName: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initWarehousearea(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
301
src/views/goods/brands/brandsAdd.vue
Normal file
301
src/views/goods/brands/brandsAdd.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 品牌名称</div>
|
||||
<el-form-item prop="brandName">
|
||||
<el-input v-model="formobj.brandName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 品牌代码</div>
|
||||
<el-form-item prop="brandCode">
|
||||
<el-input v-model="formobj.brandCode" placeholder="" class="addinputw addinputInf" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 首字母大写</div>
|
||||
<el-form-item prop="letter">
|
||||
<el-input v-model="formobj.letter" placeholder="" class="addinputw addinputInf" clearable
|
||||
oninput="value=value.replace(/[^A-Z]/g,'');" @input="letter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
|
||||
<div class="span-sty"> 品牌备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">品牌Logo</div>
|
||||
<el-form-item>
|
||||
<upload-img ref="uploadImg" class="addinputw addinputInfo" v-model="imgList" :limit="1" bucket="map"
|
||||
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }" @change="backData" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!--
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 品牌名称:</span>
|
||||
<el-input v-model="formobj.brandName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 品牌代码:</span>
|
||||
<el-input v-model="formobj.brandCode" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 首字母大写:</span>
|
||||
<el-input v-model="formobj.letter" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Z]/g,'');" @input="letter" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">品牌备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
|
||||
<span class="item_text">品牌Logo:</span>
|
||||
<upload-img ref="uploadImg" class="item_input" v-model="imgList" :limit="1" bucket="map"
|
||||
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }" @change="backData" />
|
||||
|
||||
</div>
|
||||
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/brand.js'
|
||||
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||
export default {
|
||||
components: {
|
||||
uploadImg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgList: [],
|
||||
imgList2: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
brandName: '',
|
||||
brandCode: '',
|
||||
remarks: '',
|
||||
letter: '',
|
||||
image: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
hideUploadBtn2: false,
|
||||
rules: {
|
||||
brandName: [{
|
||||
required: true,
|
||||
message: '品牌名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
brandCode: [{
|
||||
required: true,
|
||||
message: '品牌代码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
letter: [{
|
||||
required: true,
|
||||
message: '首字母大写不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.initData()
|
||||
},
|
||||
methods: {
|
||||
letter(val) {
|
||||
console.log('letter', val)
|
||||
this.formobj.letter = val
|
||||
},
|
||||
backData(value) {
|
||||
console.log('imgList', this.imgList)
|
||||
|
||||
if (this.imgList.length > 0) {
|
||||
this.formobj.image = this.imgList[0].url
|
||||
} else {
|
||||
this.formobj.image = ''
|
||||
}
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.brandName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "品牌名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.brandCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "品牌代码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.letter == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "首字母大写不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveBrands(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.imgList = []
|
||||
this.hideUploadBtn = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
brandName: '',
|
||||
brandCode: '',
|
||||
remarks: '',
|
||||
letter: '',
|
||||
image: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
console.log("this.imgList", this.imgList)
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initBrands(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
this.imgList = []
|
||||
if (resp.data.image != '') {
|
||||
this.imgList.push({
|
||||
url: resp.data.image
|
||||
})
|
||||
}
|
||||
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
this.imgList = []
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
313
src/views/goods/brands/index.vue
Normal file
313
src/views/goods/brands/index.vue
Normal file
@@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="品牌列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="品牌名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">品牌列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌Logo" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="scope.row.image" width="100%">
|
||||
<img slot="reference" :src="scope.row.image" :alt="scope.row.image"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px">
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="brandName" label="品牌名称" align="center" />
|
||||
<el-table-column prop="brandCode" label="品牌代码" align="center" />
|
||||
<el-table-column prop="letter" label="首字母大写" align="center" />
|
||||
<el-table-column prop="remarks" label="品牌备注" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/brand.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './brandsAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
376
src/views/goods/category/categoryAdd.vue
Normal file
376
src/views/goods/category/categoryAdd.vue
Normal file
@@ -0,0 +1,376 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">选择父级类别</div>
|
||||
<el-form-item>
|
||||
<el-select v-model="formobj.pname" placeholder="请选择父级类别" class="addinputw addinputInfo"
|
||||
@change="selectGoodsTypeChange">
|
||||
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 类别名称</div>
|
||||
<el-form-item prop="goodsTypeName">
|
||||
<el-input v-model="formobj.goodsTypeName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 类别编码</div>
|
||||
<el-form-item prop="goodsTypeCode">
|
||||
<el-input v-model="formobj.goodsTypeCode" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty">提成比例</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.percentageRate" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">提成金额</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.percentageAmount" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 出库规则</div>
|
||||
<el-form-item prop="outStockRuleValue">
|
||||
<el-select v-model="formobj.outStockRuleValue" placeholder="请选择出库规则" class="addinputw addinputInfo"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span>排序</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text">选择父级类别:</span>
|
||||
<el-select v-model="formobj.pname" placeholder="请选择父级类别" class="item_input" @change="selectGoodsTypeChange">
|
||||
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别名称:</span>
|
||||
<el-input v-model="formobj.goodsTypeName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别编码:</span>
|
||||
<el-input v-model="formobj.goodsTypeCode" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">提成比例:</span>
|
||||
<el-input v-model="formobj.percentageRate" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">提成金额:</span>
|
||||
<el-input v-model="formobj.percentageAmount" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 出库规则:</span>
|
||||
<el-select v-model="formobj.outStockRuleValue" placeholder="请选择出库规则" class="item_input"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">类别备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/category.js'
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
goodsTypeName: '',
|
||||
goodsTypeCode: '',
|
||||
percentageRate: '',
|
||||
percentageAmount: '',
|
||||
outStockRule: '',
|
||||
outStockRuleValue: '',
|
||||
sids: '',
|
||||
pname: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
|
||||
},
|
||||
goodsTypeList: [],
|
||||
outStockRuleList: [],
|
||||
rules: {
|
||||
goodsTypeName: [{
|
||||
required: true,
|
||||
message: '类别名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsTypeCode: [{
|
||||
required: true,
|
||||
message: '类别编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
outStockRuleValue: [{
|
||||
required: true,
|
||||
message: '请选择出库规则',
|
||||
trigger: 'change'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
console.log('>>>>>>>>>initData')
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
|
||||
req.getAllType(parpams).then(resp => {
|
||||
this.goodsTypeList = resp.data
|
||||
})
|
||||
|
||||
var params = {
|
||||
type: "goodsOutRule",
|
||||
psid: '0'
|
||||
}
|
||||
|
||||
typeValues(params).then(resp => {
|
||||
console.log('>>>>>>>>>typeValues', resp)
|
||||
this.outStockRuleList = resp.data
|
||||
}).catch(() => {})
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.goodsTypeName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.goodsTypeCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别编码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.outStockRule == '' || this.formobj.outStockRuleValue == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "请选择出库规则"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.sortNo == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别排序不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveTypes(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: '',
|
||||
goodsTypeName: '',
|
||||
goodsTypeCode: '',
|
||||
percentageRate: '',
|
||||
percentageAmount: '',
|
||||
outStockRule: '',
|
||||
outStockRuleValue: '',
|
||||
sids: '',
|
||||
pname: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initTypes(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectGoodsTypeChange(val) {
|
||||
|
||||
const choose = this.goodsTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectGoodsTypeChange', choose)
|
||||
this.formobj.sids = choose[0].sid
|
||||
this.formobj.pName = choose[0].goodsTypeName
|
||||
},
|
||||
|
||||
selectOutStockRuleChange(val) {
|
||||
console.log('>>>>>>>>>selectOutStockRuleChange', val)
|
||||
const choose = this.outStockRuleList.filter((item) => item.dictKey == val)
|
||||
console.log('>>>>>>>>>selectOutStockRuleChange', choose)
|
||||
this.formobj.outStockRule = choose[0].dictKey
|
||||
this.formobj.outStockRuleValue = choose[0].dictValue
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
381
src/views/goods/category/index.vue
Normal file
381
src/views/goods/category/index.vue
Normal file
@@ -0,0 +1,381 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="商品类别" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="类别名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别编码">
|
||||
<el-input v-model="queryParams.params.code" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否一物一码">
|
||||
<el-select v-model="queryParams.params.goodID" placeholder="请选择"
|
||||
@change="selectIsGoodIDChange">
|
||||
<el-option v-for="item in isGoodIDList" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库规则">
|
||||
<el-select v-model="queryParams.params.outStockRule" placeholder="请选择"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">类别列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否一物一码" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isGoodsID" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="0" @change="enableChange2(scope.row.sid,scope.row.isGoodsID)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsTypeName" label="类别名称" align="center" />
|
||||
<el-table-column prop="goodsTypeCode" label="类别编码" align="center" />
|
||||
<el-table-column prop="pname" label="上级类别" align="center" />
|
||||
<el-table-column prop="percentageRate" label="提成比例" align="center" />
|
||||
<el-table-column prop="percentageAmount" label="提成金额" align="center" />
|
||||
<el-table-column prop="outstockRulevalue" label="出库规则" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/category.js'
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './categoryAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
code: '',
|
||||
goodID: '',
|
||||
outStockRule: '',
|
||||
}
|
||||
},
|
||||
isGoodIDList: [{
|
||||
sid: "0",
|
||||
name: '否'
|
||||
},
|
||||
{
|
||||
sid: "1",
|
||||
name: '是'
|
||||
}
|
||||
],
|
||||
outStockRuleList: [],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
this.getDictValue()
|
||||
},
|
||||
methods: {
|
||||
getDictValue() {
|
||||
|
||||
var params = {
|
||||
type: "goodsOutRule",
|
||||
psid: '0'
|
||||
}
|
||||
|
||||
typeValues(params).then(resp => {
|
||||
console.log('>>>>>>>>>typeValues', resp)
|
||||
this.outStockRuleList = resp.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
selectIsGoodIDChange(val) {
|
||||
|
||||
},
|
||||
selectOutStockRuleChange(val) {
|
||||
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
code: '',
|
||||
goodID: '',
|
||||
outStockRule: '',
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
enableChange2(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsGoodsID(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
239
src/views/goods/factory/factoryAdd.vue
Normal file
239
src/views/goods/factory/factoryAdd.vue
Normal file
@@ -0,0 +1,239 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 厂家名称</div>
|
||||
<el-form-item prop="manufacturerName">
|
||||
<el-input v-model="formobj.manufacturerName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty"><span class="must">*</span> 厂家编码</div>
|
||||
<el-form-item prop="manufacturerCode">
|
||||
<el-input v-model="formobj.manufacturerCode" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 排序</div>
|
||||
<el-form-item prop="sortNo">
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item >
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家名称:</span>
|
||||
<el-input v-model="formobj.manufacturerName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家编码:</span>
|
||||
<el-input v-model="formobj.manufacturerCode" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">厂家备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/factory.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
manufacturerName: '',
|
||||
manufacturerCode: '',
|
||||
sortNo: '',
|
||||
remarks: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
},
|
||||
rules: {
|
||||
manufacturerName: [{
|
||||
required: true,
|
||||
message: '厂家名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
manufacturerCode: [{
|
||||
required: true,
|
||||
message: '厂家编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.manufacturerName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.manufacturerCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家编码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.sortNo == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家排序不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveFacturer(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: '',
|
||||
manufacturerName: '',
|
||||
manufacturerCode: '',
|
||||
sortNo: '',
|
||||
remarks: "",
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initFacturer(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
302
src/views/goods/factory/index.vue
Normal file
302
src/views/goods/factory/index.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="厂家列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="厂家名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">厂家列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="manufacturerName" label="厂家名称" align="center" />
|
||||
<el-table-column prop="manufacturerCode" label="厂家编码" align="center" />
|
||||
<el-table-column prop="sortNo" label="排序" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/factory.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './factoryAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
1070
src/views/goods/goods/goodsAdd.vue
Normal file
1070
src/views/goods/goods/goodsAdd.vue
Normal file
File diff suppressed because it is too large
Load Diff
509
src/views/goods/goods/goodsAdd2.vue
Normal file
509
src/views/goods/goods/goodsAdd2.vue
Normal file
@@ -0,0 +1,509 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品名称</div>
|
||||
<el-form-item prop="goodsName">
|
||||
<el-input v-model="formobj.goodsName" placeholder="商品名称" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品编码</div>
|
||||
<el-form-item prop="goodsCode">
|
||||
<el-input v-model="formobj.goodsCode" placeholder="商品编码" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">条形码</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.barCode" placeholder="由系统自动生成" :readonly="true" class="addinputw addinputInfo"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"> 拼音缩写</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.goodsPY" placeholder="由系统自动生成" :readonly="true" class="addinputw addinputInfo"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 计量单位</div>
|
||||
<el-form-item prop="goodsUnitName">
|
||||
<el-select v-model="formobj.goodsUnitName" placeholder="请选择计量单位" class="addinputw"
|
||||
@change="selectunitNameChange">
|
||||
<el-option v-for="item in unitNameList" :key="item.sid" :label="item.unitName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品类别</div>
|
||||
<el-form-item prop="goodsTypeName">
|
||||
<el-select v-model="formobj.goodsTypeName" placeholder="请选择商品类别" class="addinputw"
|
||||
@change="selectCateChange">
|
||||
<el-option v-for="item in cateList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">规格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.indexes" placeholder="规格" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">保质期(天)</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.shelfLife " placeholder="保质期(天)" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 品牌</div>
|
||||
<el-form-item prop="brandName">
|
||||
<el-select v-model="formobj.brandName" placeholder="请选择品牌" class="addinputw" @change="selectBrandChange">
|
||||
<el-option v-for="item in brandList" :key="item.sid" :label="item.brandName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="must">*</span> 厂家</div>
|
||||
<el-form-item prop="manufacturerName">
|
||||
<el-select v-model="formobj.manufacturerName" placeholder="请选择厂家" class="addinputw"
|
||||
@change="selectfacturerChange">
|
||||
<el-option v-for="item in facturerList" :key="item.sid" :label="item.manufacturerName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">原厂标志</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isOriginalFactory" size="small" class="addinputw"
|
||||
@change="selectIsOriginalFactory">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 库存上限</div>
|
||||
<el-form-item prop="inventoryAlertUpperLimit">
|
||||
<el-input v-model="formobj.inventoryAlertUpperLimit" placeholder="库存上限" class="addinputw addinputInfo"
|
||||
clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty"><span class="must">*</span> 库存下限</div>
|
||||
<el-form-item prop="inventoryAlertLowerLimit">
|
||||
<el-input v-model="formobj.inventoryAlertLowerLimit" placeholder="库存下限" class="addinputw addinputInfo"
|
||||
clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 排序</div>
|
||||
<el-form-item prop="sortNo">
|
||||
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.skuRemarks" placeholder="备注" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">锁定销售定价</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isLockingSalesPrice" size="small" class="addinputw"
|
||||
@change="selectIsLockingSalesPrice">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">销售底价</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.minimumSalesPrice" placeholder="销售底价" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">三包价格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.standardPurchasePrice" placeholder="三包价格" class="addinputw addinputInfo"
|
||||
clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">首保价格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.agencyPrice" placeholder="首保价格" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品图片</div>
|
||||
<el-form-item>
|
||||
<upload-img ref="uploadImg" class="addinputw addinputInfo" v-model="imgList" :limit="50" bucket="map"
|
||||
:upload-data="{ type: '0001' }" @change="backData" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
import req2 from '@/api/goods/brand.js'
|
||||
import req3 from '@/api/goods/category.js'
|
||||
import req4 from '@/api/goods/factory.js'
|
||||
import req5 from '@/api/goods/unit.js'
|
||||
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||
export default {
|
||||
components: {
|
||||
uploadImg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
activeNames: ['1'],
|
||||
imgList: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"userSid": window.sessionStorage.getItem('userSid'),
|
||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||
"goodsName": "",
|
||||
"goodsCode": "",
|
||||
"goodsPY": "",
|
||||
"barCode": "",
|
||||
"goodsUnitSid": "",
|
||||
"goodsUnitName": "",
|
||||
"goodsTypeSid": "",
|
||||
"goodsTypeName": "",
|
||||
"indexes": "",
|
||||
"shelfLife": "",
|
||||
"brandSid": "",
|
||||
"brandName": "",
|
||||
"manufacturerSid": "",
|
||||
"manufacturerName": "",
|
||||
"isOriginalFactory": "2",
|
||||
"isOriginalFactoryValue": "",
|
||||
"sortNo": "",
|
||||
"skuRemarks": "",
|
||||
"inventoryAlertUpperLimit": "",
|
||||
"inventoryAlertLowerLimit": "",
|
||||
"isLockingSalesPrice": "2",
|
||||
"isLockingSalesPriceValue": "",
|
||||
"minimumSalesPrice": "",
|
||||
"standardPurchasePrice": "",
|
||||
"agencyPrice": "",
|
||||
"picPath": []
|
||||
},
|
||||
brandList: [],
|
||||
cateList: [],
|
||||
facturerList: [],
|
||||
unitNameList: [],
|
||||
rules: {
|
||||
goodsName: [{
|
||||
required: true,
|
||||
message: '商品名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsCode: [{
|
||||
required: true,
|
||||
message: '商品编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsUnitName: [{
|
||||
required: true,
|
||||
message: '请选择计量单位',
|
||||
trigger: 'change'
|
||||
}],
|
||||
goodsTypeName: [{
|
||||
required: true,
|
||||
message: '请选择商品类别',
|
||||
trigger: 'change'
|
||||
}],
|
||||
brandName: [{
|
||||
required: true,
|
||||
message: '请选择商品品牌',
|
||||
trigger: 'change'
|
||||
}],
|
||||
manufacturerName: [{
|
||||
required: true,
|
||||
message: '请选择商品厂家',
|
||||
trigger: 'change'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '商品排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
inventoryAlertUpperLimit: [{
|
||||
required: true,
|
||||
message: '商品上限不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
inventoryAlertLowerLimitt: [{
|
||||
required: true,
|
||||
message: '商品下限不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
selectIsOriginalFactory(val) {
|
||||
console.log('selectIsOriginalFactory》》》》', val)
|
||||
|
||||
this.formobj.isOriginalFactoryValue = val == '1' ? '是' : '否'
|
||||
|
||||
},
|
||||
selectIsLockingSalesPrice(val) {
|
||||
console.log('selectIsLockingSalesPrice》》》》', val)
|
||||
|
||||
this.formobj.isLockingSalesPriceValue = val == '1' ? '是' : '否'
|
||||
|
||||
},
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
req2.getAllBrand(parpams).then(resp => {
|
||||
this.brandList = resp.data
|
||||
})
|
||||
req3.getAllType(parpams).then(resp => {
|
||||
this.cateList = resp.data
|
||||
})
|
||||
req4.getAllFacturer(parpams).then(resp => {
|
||||
this.facturerList = resp.data
|
||||
})
|
||||
req5.getAllUnit(parpams).then(resp => {
|
||||
this.unitNameList = resp.data
|
||||
})
|
||||
},
|
||||
backData(value) {
|
||||
console.log('backData》》》》', value)
|
||||
console.log('imgList', this.imgList)
|
||||
|
||||
this.formobj.picPath = this.imgList
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
req.saveGoods(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": "",
|
||||
"userSid": window.sessionStorage.getItem('userSid'),
|
||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||
"goodsName": "",
|
||||
"goodsCode": "",
|
||||
"goodsPY": "",
|
||||
"barCode": "",
|
||||
"goodsUnitSid": "",
|
||||
"goodsUnitName": "",
|
||||
"goodsTypeSid": "",
|
||||
"goodsTypeName": "",
|
||||
"indexes": "",
|
||||
"shelfLife": "",
|
||||
"brandSid": "",
|
||||
"brandName": "",
|
||||
"manufacturerSid": "",
|
||||
"manufacturerName": "",
|
||||
"isOriginalFactory": "2",
|
||||
"isOriginalFactoryValue": "",
|
||||
"sortNo": "",
|
||||
"skuRemarks": "",
|
||||
"inventoryAlertUpperLimit": "",
|
||||
"inventoryAlertLowerLimit": "",
|
||||
"isLockingSalesPrice": "2",
|
||||
"isLockingSalesPriceValue": "",
|
||||
"minimumSalesPrice": "",
|
||||
"standardPurchasePrice": "",
|
||||
"agencyPrice": "",
|
||||
"picPath": []
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
// var sid = require('uuid').v1()
|
||||
// console.log('>>>>>>>>>showAdd', sid)
|
||||
|
||||
// this.formobj.sid = sid
|
||||
},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectBrandChange(val) {
|
||||
const choose = this.brandList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectBrandChange', choose)
|
||||
this.formobj.brandSid = choose[0].sid
|
||||
this.formobj.brandName = choose[0].brandName
|
||||
},
|
||||
selectCateChange(val) {
|
||||
const choose = this.cateList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectCateChange', choose)
|
||||
this.formobj.goodsTypeSid = choose[0].sid
|
||||
this.formobj.goodsTypeName = choose[0].goodsTypeName
|
||||
},
|
||||
selectfacturerChange(val) {
|
||||
const choose = this.facturerList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectfacturerChange', choose)
|
||||
this.formobj.manufacturerSid = choose[0].sid
|
||||
this.formobj.manufacturerName = choose[0].manufacturerName
|
||||
},
|
||||
selectunitNameChange(val) {
|
||||
const choose = this.unitNameList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectunitNameChange', choose)
|
||||
this.formobj.goodsUnitSid = choose[0].sid
|
||||
this.formobj.goodsUnitName = choose[0].unitName
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
585
src/views/goods/goods/goodsInfo.vue
Normal file
585
src/views/goods/goods/goodsInfo.vue
Normal file
@@ -0,0 +1,585 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品名称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品简称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsShortName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品副标题</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.subTitle}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品拼音缩写</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsPY}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品条形码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.barCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品品牌</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.brandName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品类别</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.typeName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品单位</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsUnitName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品厂家</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.manufacturerName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">厂家货号</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.factoryCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否上架</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isListed" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">上架</el-radio>
|
||||
<el-radio :label="'2'">下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">外部编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.externalCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">国标码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.nationalStandardCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税率</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.taxRate}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">保质期天</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.shelfLife}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.remarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品详细说明</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.goodsExplain}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品描述</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.goodsDescription}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品通用规格参数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.genericSpec}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品特有规格参数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.specialSpec}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>规格列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.baseGoodsSkus" border>
|
||||
<!-- <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="goodsSkuCode" align="center" />
|
||||
<el-table-column label="商品标题" prop="title" align="center" />
|
||||
<el-table-column label="外部编码" prop="externalCode" align="center" />
|
||||
<el-table-column label="特有规格属性" prop="indexes" align="center" />
|
||||
<el-table-column label="特有规格参数" prop="ownSpec" align="center" />
|
||||
<el-table-column label="规格明细" wid align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="showGoodsSkuDttail(scope.row.baseGoodsSkuExtend)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-dialog title="查看规格明细" :visible.sync="dialogVisible" :before-close="handleClose">
|
||||
|
||||
<el-form ref="dataForm1" class="formaddcopy02" style="margin-top: -40px;" :model="itemInfo">
|
||||
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">最后采购价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.finalPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">安全库存天数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.safetyStockDays}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否原厂</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isOriginalFactory" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否库存警戒</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isInventoryAlert" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">库存警戒上线</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.inventoryAlertUpperLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">库存警戒下线</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.inventoryAlertLowerLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">成本价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.costPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">吊牌价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.tagPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">销售单价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.salesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">标准进价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.standardPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">代理价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.agencyPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">折扣</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.discount}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">最低零售价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.minimumSalesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否积分兑换</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isIntegralExchange" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">积分数量</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.integralAmount}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">锁定销售价格</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isLockingSalesPrice" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.remarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">规格图片</div>
|
||||
<el-form-item>
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in itemInfo.urls" :key="index" class="addinputInfo">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="item.url" width="100%" />
|
||||
<img slot="reference" :src="item.url" :alt="item.url"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
|
||||
<el-button type="primary" style="margin-top: 20px;" @click="handleClose">关 闭</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
activeNames: ['1'],
|
||||
imgList: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
goodsName: "",
|
||||
goodsCode: "",
|
||||
brandSid: "",
|
||||
brand: "",
|
||||
goodsTypeSid: "",
|
||||
typeName: "",
|
||||
manufacturersid: "",
|
||||
manufacturer: "",
|
||||
externalCode: '',
|
||||
factoryCode: '',
|
||||
taxRate: '',
|
||||
shelfLife: '',
|
||||
baseGoodsSpuDetail: {
|
||||
goodsExplain: "",
|
||||
goodsDescription: ""
|
||||
},
|
||||
baseGoodsSkuDtos: []
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
dialogVisible: false,
|
||||
dialogVisible2: false,
|
||||
itemInfo: {},
|
||||
orderInfo: {}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.imgList = []
|
||||
this.hideUploadBtn = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
brand: "",
|
||||
brandSid: "",
|
||||
typeName: "",
|
||||
goodsTypeSid: "",
|
||||
manufacturer: "",
|
||||
manufacturerSid: "",
|
||||
goodsName: '',
|
||||
goodsCode: '',
|
||||
barcode: '',
|
||||
producer: '',
|
||||
unit: '',
|
||||
specification: '',
|
||||
remarks: '',
|
||||
baseGoodsSpuDetail: {
|
||||
goodsExplain: "",
|
||||
goodsDescription: ""
|
||||
},
|
||||
baseGoodsSku: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
showGoodsSkuDttail(goodsSkuDto) {
|
||||
console.log('>>>>>>>>>showGoodsSkuDttail', goodsSkuDto)
|
||||
|
||||
this.dialogVisible = true
|
||||
this.itemInfo = goodsSkuDto
|
||||
},
|
||||
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleClose2() {
|
||||
this.dialogVisible2 = false
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
270
src/views/goods/goods/goodsInfo2.vue
Normal file
270
src/views/goods/goods/goodsInfo2.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品名称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品条形码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.barCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品拼音缩写</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsPY}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品单位</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsUnitName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品类别</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsTypeName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">规格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.indexes}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">保质期(天)</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.shelfLife}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品品牌</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.brandName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">商品厂家</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.manufacturerName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">原厂标志</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isOriginalFactory" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">商品备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.skuRemarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">库存上限</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.inventoryAlertUpperLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">库存下限</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.inventoryAlertLowerLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">锁定销售定价</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isLockingSalesPrice" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">销售底价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.minimumSalesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">三包价格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.standardPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">首保价格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.agencyPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">规格图片</div>
|
||||
<el-form-item>
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in formobj.picPath" :key="index" class="addinputInfo">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="item.url" width="100%" />
|
||||
<img slot="reference" :src="item.url" :alt="item.url"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
443
src/views/goods/goods/index.vue
Normal file
443
src/views/goods/goods/index.vue
Normal file
@@ -0,0 +1,443 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="商品列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit" :hidden="false">商品列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column width="50" type="selection" align="center" />
|
||||
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">详情</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="barCode" label="商品条码" align="center" />
|
||||
<el-table-column prop="brandName" label="商品品牌" align="center" />
|
||||
<el-table-column prop="typeName" label="商品类别" align="center" />
|
||||
<el-table-column prop="goodsUnitName" label="商品单位" align="center" />
|
||||
<el-table-column prop="manufacturerName" label="商品厂家" align="center" />
|
||||
<el-table-column prop="nationalStandardCode" label="国标码" align="center" />
|
||||
<el-table-column prop="taxRate" label="税率" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<!-- 详情部分组件 -->
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
<!-- 导入 -->
|
||||
<el-dialog :visible.sync="dialogVisible" width="60%" :show-close="false">
|
||||
<div style="margin-top: -40px;">
|
||||
<el-button size="medium" type="text" style="font-weight: bold" @click="downLoad">下载商品导入明细模板</el-button>
|
||||
|
||||
</div>
|
||||
<div style="margin-top: 10px;font-weight: bold">导入的EXCEL中的抬头的顺序和名字请保持一致!否则导入数据不正确。</div>
|
||||
<div style="margin-top: 5px;font-weight: bold">导入之前,请仔细检查数据中不能存在"\这些特殊字符。</div>
|
||||
<div style="margin-top: 5px;font-weight: bold">只能导入xls或者xlsx文件,如果导入内容较多,请耐心等待响应。</div>
|
||||
<el-card class="box-card" style="margin-top: 10px;">
|
||||
<div>
|
||||
<el-upload ref="upload" class="upload-demo" accept=".xls,.xlsx" name="file" :action="updateAction"
|
||||
:on-success="handleSuccess" :file-list="fileList" :auto-upload="false" :multiple="false" :limit="1"
|
||||
:data="uploadData" :headers="headers">
|
||||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div>
|
||||
<h3>文件上传结果</h3>
|
||||
<el-card class="box-card">
|
||||
<div>{{ uploadResultMesssage }}</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
||||
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './goodsAdd.vue'
|
||||
import divInfo from './goodsInfo.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo,
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
btndisabled: false,
|
||||
updateAction: process.env.VUE_APP_BASE_API + '/wms/apiadmin/base/basegoodsspu/importExcel',
|
||||
fileList: [],
|
||||
uploadSuccess: false,
|
||||
uploadResultMesssage: '',
|
||||
uploadData: {
|
||||
sid: ''
|
||||
},
|
||||
headers: {
|
||||
token: window.sessionStorage.getItem('token')
|
||||
},
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'success',
|
||||
size: 'small',
|
||||
icon: '',
|
||||
btnKey: 'doImport',
|
||||
btnLabel: '导入商品'
|
||||
}, {
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
downLoad() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.downloadExcel().then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '商品导入明细模版' + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
handleSuccess(resp, file, fileList) {
|
||||
const _this = this
|
||||
_this.uploadResultMesssage = resp.msg
|
||||
_this.uploadSuccess = resp.success
|
||||
|
||||
},
|
||||
handleConfirm() {
|
||||
if (!this.uploadSuccess) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '请先上传商品导入明细'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dialogVisible = false
|
||||
this.loadList()
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case "doImport":
|
||||
this.doImport()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
doImport() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
302
src/views/goods/unit/index.vue
Normal file
302
src/views/goods/unit/index.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="计量单位" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="计量单位名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">计量单位列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitName" label="计量单位名称" align="center" />
|
||||
<el-table-column prop="remarks" label="计量单位备注" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/unit.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './unitAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
178
src/views/goods/unit/unitAdd.vue
Normal file
178
src/views/goods/unit/unitAdd.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 计量单位名称</div>
|
||||
<el-form-item prop="unitName">
|
||||
<el-input v-model="formobj.unitName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 计量单位名称:</span>
|
||||
<el-input v-model="formobj.unitName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">计量单位备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/unit.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
unitName: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
},
|
||||
rules: {
|
||||
unitName: [{
|
||||
required: true,
|
||||
message: '计量单位名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.initData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.unitName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "计量单位名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveUnits(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: '',
|
||||
unitName: '',
|
||||
remarks: '',
|
||||
useOrgSid: window.sessionStorage.getItem('departmentSid'),
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initUnits(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
448
src/views/inStorage/deliveryNotice/index.vue
Normal file
448
src/views/inStorage/deliveryNotice/index.vue
Normal file
@@ -0,0 +1,448 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="预期到货通知单管理" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购单号">
|
||||
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeKey" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="item.sid" :label="item.name" :value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="queryParams.params.supplierName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="预计到货日期">
|
||||
<el-date-picker v-model="queryParams.params.deliveryDateStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
至
|
||||
<el-date-picker v-model="queryParams.params.deliveryDateEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="queryParams.params.billState" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billStateList" :key="item.sid" :label="item.name" :value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态">
|
||||
<el-select v-model="queryParams.params.reviewStatus" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in reviewStatusList" :key="item.sid" :label="item.name" :value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">预期到货通知单列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" width="220" />
|
||||
<el-table-column prop="createTime" label="单据日期" align="center" width="150" />
|
||||
<el-table-column prop="createByName" label="制单人" align="center" width="150" />
|
||||
<el-table-column prop="sourceBillNo" label="采购单号" align="center" width="180" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="150" />
|
||||
<el-table-column prop="supplierName" label="供应商" align="center" width="150" />
|
||||
<el-table-column prop="contact" label="联系人" align="center" width="150" />
|
||||
<el-table-column prop="mobile" label="联系人电话" align="center" width="150" />
|
||||
<el-table-column prop="deliveryDate" label="预计到货日期" align="center" width="150" />
|
||||
<el-table-column prop="billState" label="单据状态" align="center" width="150" />
|
||||
<el-table-column prop="reviewStatus" label="审核状态" align="center" width="150" />
|
||||
<el-table-column prop="refuseReason" label="拒绝原因" align="center" width="150" />
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
<el-dialog title="审核单据" :visible.sync="dialogVisible" :before-close="handleClose">
|
||||
<el-form ref="dataForm" class="formadd" style="margin-top: -40px;" :model="formobj">
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">审核结果</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item class="trightb_item">
|
||||
<el-radio-group v-model="formobj.reviewStatus" size="small" @change="changeTheme">
|
||||
<el-radio :label="1">合格</el-radio>
|
||||
<el-radio :label="2">不合格</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">审核意见</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item class="trightb_item">
|
||||
<el-input v-model="formobj.remarks" placeholder="请填写审核意见" class="addinputw" style="width:100%"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
|
||||
<el-button type="primary" style="margin-top: 20px;" @click="saveExamine">确 定</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/deliveryNotice.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './receiptAdd.vue'
|
||||
import divInfo from './receiptInfo.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formobj: {
|
||||
sid: "",
|
||||
reviewStatus: "",
|
||||
remarks: ''
|
||||
},
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAudit',
|
||||
btnLabel: '审核'
|
||||
}, {
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '收货'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: [],
|
||||
busTypeList: [{
|
||||
name: "采购预约",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "调拨预约",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "其他预约",
|
||||
sid: "2"
|
||||
}
|
||||
],
|
||||
billStateList: [{
|
||||
name: "在途",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "部分收货",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "已收货",
|
||||
sid: "2"
|
||||
},
|
||||
{
|
||||
name: "已取消",
|
||||
sid: "3"
|
||||
}
|
||||
],
|
||||
reviewStatusList: [{
|
||||
name: "待审核",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "审核通过",
|
||||
sid: "2"
|
||||
},
|
||||
{
|
||||
name: "审核拒绝",
|
||||
sid: "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
saveExamine() {
|
||||
|
||||
},
|
||||
changeTheme() {
|
||||
|
||||
},
|
||||
toAudit() {
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selectTime1() {
|
||||
|
||||
},
|
||||
selectTime2() {
|
||||
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAudit':
|
||||
this.toAudit()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(this.selectionList[0].billState=='已收货'){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "此记录已完成,不可重复操作。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
746
src/views/inStorage/deliveryNotice/receiptAdd.vue
Normal file
746
src/views/inStorage/deliveryNotice/receiptAdd.vue
Normal file
@@ -0,0 +1,746 @@
|
||||
<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="primary" size="small" :disabled="submitdisabled" @click="submintdate">确认</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<!-- <div class="title">
|
||||
<div>基础信息</div>
|
||||
</div> -->
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单部门</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商</div>
|
||||
<el-select v-model="formobj.supplierName" placeholder="请选择" clearable @change="selectSupplierName"
|
||||
class="addinputInfo">
|
||||
<el-option v-for="(item,i) in supplierNameList" :key="item.sid" :label="item.supplierName"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<!-- <el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 到货日期</div>
|
||||
<el-form-item prop="deliveryDate">
|
||||
<el-date-picker v-model="formobj.deliveryDate" type="date" class="addinputInfo" value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
||||
type="textarea" :rows="4" clearable /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>商品列表</div>
|
||||
<el-button type="primary" size="mini" class="btntopblueline" @click="batchAddAll()">批次收货</el-button>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border style="width: 100%;">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" wid align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="doGoods(scope.row)">删除</el-button>
|
||||
<el-button type="primary" size="mini" @click="doAddBatch(scope.row)">批次+</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<!-- <el-table-column label="仓库" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseName" placeholder="请选择" clearable
|
||||
@change="selectWarehouseName(scope.row,$event)">
|
||||
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库位" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseRackName" :disabled="scope.row.warehouseName==''" clearable
|
||||
@focus="getWarehouseAreaList(scope.row.warehouseSid)" placeholder="请选择"
|
||||
@change="selectWarehouseAreaCode">
|
||||
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="预约数量" prop="orderCount" align="center" width="120" /> -->
|
||||
<el-table-column label="实收数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" @input="commodityComputeYHAndXSJE(scope.row,$event)"
|
||||
v-model="scope.row.actualInCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拒收数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.rejectCount" clearable placeholder=""
|
||||
@input="commodityComputeYHAndXSJE2(scope.row,$event)"
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拒收原因" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.rejectReason" clearable placeholder="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否质检" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-radio-group v-model="scope.row.isQuality" size="small" @change="changeTheme">
|
||||
<el-radio :label="0">是</el-radio>
|
||||
<el-radio :label="1">否</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质检状态" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-radio-group v-model="scope.row.qualityState" size="small" @change="changeTheme2">
|
||||
<el-radio :label="0">合格</el-radio>
|
||||
<el-radio :label="1">不合格</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="载具说明" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.packageRemark" clearable placeholder="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库单价" prop="cost" align="center" width="100" />
|
||||
<el-table-column label="税率" prop="taxAmount" align="center" width="100" />
|
||||
<!-- <el-table-column label="含税单价" prop="taxPrice" align="center" width="100" /> -->
|
||||
<el-table-column label="入库金额" prop="amount" align="center" width="100" />
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="title">
|
||||
<div>商品-批次</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.pcList" border style="width: 100%;">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" wid align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="doGoodsBatch(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品列表序号" prop="xh" align="center" width="120" />
|
||||
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<el-table-column label="仓库" prop="unit" align="center" width="150" />
|
||||
<el-table-column label="库位" prop="unit" align="center" width="150" />
|
||||
<el-table-column label="批次号" prop="batchNumber" align="center" width="300" />
|
||||
<el-table-column label="生产日期" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-date-picker v-model="scope.row.manufactureDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期" @change="manufactureDateChange(scope.row,$event)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期" prop="expirationDate" align="center" width="180" />
|
||||
<el-table-column label="数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.batchCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/deliveryNotice.js'
|
||||
import {
|
||||
getCurrentDate
|
||||
} from '@/utils/index.js'
|
||||
import {
|
||||
choiceSupplierInfo,
|
||||
getOrgSidByPath,
|
||||
getWarehouses,
|
||||
getWarehouseareas
|
||||
} from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
activeNames: ['1'],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sourceBillNo: "",
|
||||
busTypeKey: "",
|
||||
busTypeValue: "",
|
||||
createTime: '',
|
||||
createByName: window.sessionStorage.getItem('name'),
|
||||
deptName: '',
|
||||
deptSid: '',
|
||||
createBySid: window.sessionStorage.getItem('userSid'),
|
||||
useOrgSid: '',
|
||||
createOrgSid: '',
|
||||
billState: '新建',
|
||||
billStateKey: 0,
|
||||
reviewStatus: "",
|
||||
refuseReason: "",
|
||||
contact: "",
|
||||
mobile: "",
|
||||
supplierSid: "",
|
||||
supplierName: "",
|
||||
goodsOwnerSid: "",
|
||||
goodsOwner: "",
|
||||
deliveryDate: getCurrentDate(),
|
||||
list: [],
|
||||
pcList: []
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
warehouseList: [],
|
||||
warehouseRackList: [],
|
||||
supplierNameList: [],
|
||||
rules: {
|
||||
deliveryDate: [{
|
||||
required: true,
|
||||
message: '到货日期不能为空',
|
||||
trigger: 'change'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// getOrgPathSid() {
|
||||
// getOrgSidByPath({
|
||||
// orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
// }).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.formobj.createOrgSid = res.data
|
||||
// this.formobj.useOrgSid = res.data
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
|
||||
init() {
|
||||
getOrgSidByPath({
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.createOrgSid = res.data
|
||||
this.formobj.useOrgSid = res.data
|
||||
|
||||
this.getsupplierLust()
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
selectSupplierName(val) {
|
||||
|
||||
console.log("supplierNameSelect", val);
|
||||
const choose = this.supplierNameList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>supplierNameSelect', choose)
|
||||
this.formobj.supplierName = choose[0].supplierName
|
||||
this.formobj.supplierSid = choose[0].sid
|
||||
|
||||
},
|
||||
getsupplierLust() {
|
||||
|
||||
// getOrgSidByPath({
|
||||
// orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
// }).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.formobj.createOrgSid = res.data
|
||||
// this.formobj.useOrgSid = res.data
|
||||
// req.choiceSupplierInfo(res.data).then((resp) => {
|
||||
// if (resp.success) {
|
||||
// this.supplierNameList = resp.data
|
||||
// console.log("aaaaaa", this.supplierNameList);
|
||||
// }
|
||||
// })
|
||||
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
choiceSupplierInfo({
|
||||
createOrgSid: this.formobj.createOrgSid
|
||||
}).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.supplierNameList = resp.data
|
||||
console.log("aaaaaa", this.supplierNameList);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getWarehouseList() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
getWarehouses(parpams).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getWarehouseAreaList(sid) {
|
||||
var query = {
|
||||
ckSid: sid
|
||||
}
|
||||
getWarehouseareas(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseRackList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseRackList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWarehouseName(row, val) {
|
||||
console.log("selectWarehouseName", row);
|
||||
console.log("selectWarehouseName", val);
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
row.warehouseName = choose[0].warehouseName
|
||||
row.warehouseSid = choose[0].sid
|
||||
|
||||
},
|
||||
selectWarehouseAreaCode(val) {
|
||||
console.log("selectWarehouseAreaCode", val);
|
||||
|
||||
const choose = this.warehouseRackList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
|
||||
row.warehouseRackName = choose[0].areaCode
|
||||
row.warehouseRackSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
batchAddAll() {
|
||||
|
||||
for (var i = 0; i < this.formobj.list.length; i++) {
|
||||
var item = this.formobj.list[i]
|
||||
|
||||
var info = {
|
||||
xh: i + 1,
|
||||
goodsSkuSid: item.goodsSkuSid,
|
||||
goodsSkuTitle: item.goodsSkuTitle,
|
||||
goodsSkuCode: item.goodsSkuCode,
|
||||
goodsSkuOwnSpec: item.goodsSkuOwnSpec,
|
||||
unit: item.unit,
|
||||
warehouseSid: item.warehouseSid,
|
||||
warehouseName: item.warehouseName,
|
||||
warehouseRackSid: item.warehouseRackSid,
|
||||
warehouseRackName: item.warehouseRackName,
|
||||
shelfLife: item.shelfLife,
|
||||
orderCount: item.orderCount,
|
||||
batchNumber: '',
|
||||
manufactureDate: '',
|
||||
batchCount: 0,
|
||||
}
|
||||
|
||||
this.formobj.pcList.push(info)
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
doGoods(row) {
|
||||
console.log("doGoodsDel》》》》", row)
|
||||
|
||||
this.$confirm("是否确定删除此商品?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const index = this.formobj.list.findIndex((item) => item === row)
|
||||
console.log("index》》》》", index)
|
||||
this.formobj.list.splice(index, 1)
|
||||
|
||||
for (var i = this.formobj.pcList.length - 1; i >= 0; i--) {
|
||||
if (this.formobj.pcList[i].xh === (index + 1)) {
|
||||
this.formobj.pcList.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
doGoodsBatch(row) {
|
||||
console.log("doGoodsDel》》》》", row)
|
||||
|
||||
this.$confirm("是否确定删除此商品?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const index = this.formobj.pcList.findIndex((item) => item === row)
|
||||
console.log("index》》》》", index)
|
||||
this.formobj.pcList.splice(index, 1)
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
manufactureDateChange(row, val) {
|
||||
|
||||
console.log("manufactureDateChange》》》》", val)
|
||||
|
||||
row.manufactureDate = val
|
||||
row.expirationDate = this.addDate(val, row.shelfLife)
|
||||
|
||||
let reg = new RegExp('-', 'g') //g代表全部
|
||||
|
||||
row.batchNumber = this.formobj.deliveryDate.replace(reg, '') + " - " + row.expirationDate.replace(reg, '')
|
||||
|
||||
|
||||
|
||||
this.$forceUpdate(); // 强制更新
|
||||
console.log("manufactureDateChange》》》》", row)
|
||||
|
||||
},
|
||||
|
||||
addDate(date, days) {
|
||||
var dates = new Date(date)
|
||||
dates.setDate(dates.getDate() + days)
|
||||
var year = dates.getFullYear()
|
||||
var month = dates.getMonth() + 1
|
||||
var day = dates.getDate()
|
||||
if (month < 9) {
|
||||
month = "0" + month
|
||||
}
|
||||
if (day < 9) {
|
||||
day = "0" + day
|
||||
}
|
||||
var time = year + '-' + month + '-' + day
|
||||
return time
|
||||
},
|
||||
|
||||
doAddBatch(row) {
|
||||
const index = (this.formobj.list.findIndex((item) => item === row)) + 1
|
||||
console.log("doAddBatch》》》》", index)
|
||||
console.log("doAddBatch》》》》", row)
|
||||
|
||||
var info = {
|
||||
xh: index,
|
||||
goodsSkuSid: row.goodsSkuSid,
|
||||
goodsSkuTitle: row.goodsSkuTitle,
|
||||
goodsSkuCode: row.goodsSkuCode,
|
||||
goodsSkuOwnSpec: row.goodsSkuOwnSpec,
|
||||
unit: row.unit,
|
||||
warehouseSid: row.warehouseSid,
|
||||
warehouseName: row.warehouseName,
|
||||
warehouseRackSid: row.warehouseRackSid,
|
||||
warehouseRackName: row.warehouseRackName,
|
||||
shelfLife: row.shelfLife,
|
||||
orderCount: row.orderCount,
|
||||
batchNumber: '',
|
||||
manufactureDate: '',
|
||||
expirationDate: '',
|
||||
batchCount: 0,
|
||||
}
|
||||
|
||||
console.log("aaaaaaaaaaa", info);
|
||||
|
||||
this.formobj.pcList.push(info)
|
||||
|
||||
},
|
||||
commodityComputeYHAndXSJE(row, val) {
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
|
||||
// if (Number(row.actualInCount) > Number(row.orderCount)) {
|
||||
row.actualInCount = val
|
||||
// }
|
||||
|
||||
row.amount = (Number(row.actualInCount) * Number(row.cost)).toFixed(2)
|
||||
|
||||
|
||||
},
|
||||
|
||||
commodityComputeYHAndXSJE2(row, val) {
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
row.rejectCount = val
|
||||
// if ((Number(row.rejectCount) + Number(row.actualInCount)) > Number(row.orderCount)) {
|
||||
// row.rejectCount = Number(row.orderCount) - Number(row.actualInCount)
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
changeTheme() {
|
||||
|
||||
},
|
||||
|
||||
changeTheme2() {
|
||||
|
||||
},
|
||||
|
||||
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.deliveryDate == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'error',
|
||||
// message: '到货日期不能为空'
|
||||
// })
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
submintdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
|
||||
// if (this.formobj.deliveryDate == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'error',
|
||||
// message: '到货日期不能为空'
|
||||
// })
|
||||
|
||||
// return
|
||||
// }
|
||||
|
||||
for (var i = 0; i < this.formobj.list.length; i++) {
|
||||
|
||||
if (Number(this.formobj.list[i].actualInCount) == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '商品实收数量不能为空'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.formobj.pcList.length; i++) {
|
||||
|
||||
if (this.formobj.pcList[i].expirationDate == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '生产日期不能为空'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (Number(this.formobj.pcList[i].batchCount) == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '批次数量不能为0'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.submit(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.submitdisabled = false
|
||||
this.formobj = {
|
||||
sourceBillNo: "",
|
||||
busTypeKey: "",
|
||||
busTypeValue: "",
|
||||
createByName: "",
|
||||
billState: 0,
|
||||
reviewStatus: "",
|
||||
refuseReason: "",
|
||||
contact: "",
|
||||
mobile: "",
|
||||
supplierSid: "",
|
||||
supplierName: "",
|
||||
goodsOwnerSid: "",
|
||||
goodsOwner: "",
|
||||
deliveryDate: "",
|
||||
list: [],
|
||||
pcList: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
this.init()
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
// this.getWarehouseList()
|
||||
|
||||
// this.getOrgPathSid()
|
||||
var params = {
|
||||
sourceSid: row.sid
|
||||
}
|
||||
|
||||
req.getInitDetails(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
this.formobj.deliveryDate = getCurrentDate()
|
||||
|
||||
// this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window
|
||||
// .sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
|
||||
// this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage
|
||||
// .getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
175
src/views/inStorage/deliveryNotice/receiptInfo.vue
Normal file
175
src/views/inStorage/deliveryNotice/receiptInfo.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>预期到货通知单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<!-- <div class="title">
|
||||
<div>基础信息</div>
|
||||
</div> -->
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据编号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">预期到货日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.deliveryDate }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">审核状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.reviewStatus }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">拒绝原因</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.refuseReason }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border style="width: 100%;">
|
||||
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80" />
|
||||
<el-table-column fixed label="商品名称" prop="goodsSkuTitle" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<!-- <el-table-column label="仓库" prop="warehouseName" align="center" width="120" />
|
||||
<el-table-column label="库位" prop="warehouseRack" align="center" width="120" /> -->
|
||||
<el-table-column label="预约数量" prop="orderCount" align="center" width="120" />
|
||||
<el-table-column label="待收货数量" prop="waitInCount" align="center" />
|
||||
<el-table-column label="已收货数量" prop="actualInCount" align="center" />
|
||||
<el-table-column label="入库单价" prop="cost" align="center" width="100" />
|
||||
<el-table-column label="税率" prop="taxAmount" align="center" width="100" />
|
||||
<!-- <el-table-column label="含税单价" prop="taxPrice" align="center" width="100" /> -->
|
||||
<el-table-column label="采购金额" prop="amount" align="center" />
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/deliveryNotice.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
433
src/views/inStorage/receivingGoods/index.vue
Normal file
433
src/views/inStorage/receivingGoods/index.vue
Normal file
@@ -0,0 +1,433 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="收货单管理" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="预期到货通知单号">
|
||||
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeKey" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="queryParams.params.supplierName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="到货日期">
|
||||
<el-date-picker v-model="queryParams.params.deliveryDateStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
至
|
||||
<el-date-picker v-model="queryParams.params.deliveryDateEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="queryParams.params.billState" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billStateList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">收货单列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" :disabled="scope.row.billState=='已完成'"
|
||||
@click="toEdit(scope.row)">办理</el-button>
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billNo" width="220" label="单据编号" align="center" />
|
||||
<el-table-column prop="createTime" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人" align="center" />
|
||||
<el-table-column prop="sourceBillNo" label="预期到货通知单号" width="220"align="center" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
|
||||
<el-table-column prop="supplierName" label="供应商" align="center" />
|
||||
<el-table-column prop="deliveryDate" label="到货日期" align="center" />
|
||||
<el-table-column prop="billState" label="单据状态" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
<divAddupShelfRecord v-show="viewState == 5" ref="divAddupShelfRecord" @doback="resetState"
|
||||
@reloadlist="loadList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/receivingGoods.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './receivingGoodsAdd.vue'
|
||||
import divInfo from './receivingGoodsInfo.vue'
|
||||
import divAddupShelfRecord from './upShelfAddRecord.vue'
|
||||
import {
|
||||
getTypeValueList
|
||||
} from '@/api/Common/dictcommons'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo,
|
||||
divAddupShelfRecord
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formobj: {
|
||||
sid: "",
|
||||
reviewStatus: "",
|
||||
remarks: ''
|
||||
},
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAudit',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '上架'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: [],
|
||||
busTypeList: [
|
||||
],
|
||||
billStateList: [{
|
||||
name: "新建",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "已完成",
|
||||
sid: "1"
|
||||
},
|
||||
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
|
||||
getTypeValueList({ type: 'wms_busType', groupNum: 'wms_rk' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.busTypeList = res.data
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
saveExamine() {
|
||||
|
||||
},
|
||||
changeTheme() {
|
||||
|
||||
},
|
||||
toAudit() {
|
||||
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
|
||||
},
|
||||
selectTime1() {
|
||||
|
||||
},
|
||||
selectTime2() {
|
||||
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAudit':
|
||||
this.toAudit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
toAdd() {
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.selectionList[0].billState == '新建') {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "此记录未完成,不可操作。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 5
|
||||
this.$refs['divAddupShelfRecord'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toEdit(row) {
|
||||
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
1101
src/views/inStorage/receivingGoods/receivingGoodsAdd.vue
Normal file
1101
src/views/inStorage/receivingGoods/receivingGoodsAdd.vue
Normal file
File diff suppressed because it is too large
Load Diff
206
src/views/inStorage/receivingGoods/receivingGoodsInfo.vue
Normal file
206
src/views/inStorage/receivingGoods/receivingGoodsInfo.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>收货单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<!-- <div class="title">
|
||||
<div>基础信息</div>
|
||||
</div> -->
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单部门</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">到货日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.deliveryDate }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><span class="addinputInfo">{{formobj.remarks}}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border style="width: 100%;">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<!-- <el-table-column label="仓库" prop="warehouseName" align="center" width="180" />
|
||||
<el-table-column label="库位" prop="warehouseRackName" align="center" width="180" />
|
||||
<el-table-column label="预约数量" prop="orderCount" align="center" width="120" /> -->
|
||||
<el-table-column label="实收数量" prop="actualInCount" align="center" width="120" />
|
||||
<el-table-column label="拒收数量" prop="rejectCount" align="center" width="120" />
|
||||
<el-table-column label="拒收原因" prop="rejectReason" align="center" width="180" />
|
||||
<el-table-column label="是否质检" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-radio-group v-model="scope.row.isQuality" :disabled="true" size="small">
|
||||
<el-radio :label="0">是</el-radio>
|
||||
<el-radio :label="1">否</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="质检状态" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-radio-group v-model="scope.row.qualityState" :disabled="true" size="small">
|
||||
<el-radio :label="0">合格</el-radio>
|
||||
<el-radio :label="1">不合格</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="载具说明" prop="packageRemark" align="center" width="180" />
|
||||
<el-table-column label="入库单价" prop="cost" align="center" width="100" />
|
||||
<el-table-column label="税率" prop="taxAmount" align="center" width="100" />
|
||||
<!-- <el-table-column label="含税单价" prop="taxPrice" align="center" width="100" /> -->
|
||||
<el-table-column label="入库金额" prop="amount" align="center" width="100" />
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>商品-批次</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.pcList" border style="width: 100%;">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="商品列表序号" prop="xh" align="center" width="120" />
|
||||
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" width="150" />
|
||||
<el-table-column label="库位" prop="warehouseRackName" align="center" width="150" />
|
||||
<el-table-column label="批次号" prop="batchNumber" align="center" width="300" />
|
||||
<el-table-column label="生产日期" prop="manufactureDate" align="center" width="180" />
|
||||
<el-table-column label="有效期" prop="expirationDate" align="center" width="180" />
|
||||
<el-table-column label="数量" prop="batchCount" align="center" width="120" />
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/receivingGoods.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
164
src/views/inStorage/receivingGoods/relation/chooseproducts.vue
Normal file
164
src/views/inStorage/receivingGoods/relation/chooseproducts.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<div class="tab-header webtop">
|
||||
<div>选择商品</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<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="120px" class="tab-header">
|
||||
<el-form-item label="商品名称" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" class="searchlist">
|
||||
<el-input v-model="listQuery.params.manufacturerName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</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 :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column width="50px" type="selection" align="center"/>
|
||||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="indexes" label="规格" align="center" />
|
||||
<el-table-column prop="goodsUnitName" label="单位" align="center" />
|
||||
<el-table-column prop="manufacturerName" label="供应商" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<Pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import { chooseproducts } from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'SelectVehicle',
|
||||
components: {
|
||||
Pagination
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '隐藏查询条件',
|
||||
tableKey: 0,
|
||||
sids: [],
|
||||
list: [],
|
||||
number: '',
|
||||
listLoading: false,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
params: {
|
||||
createOrgSid: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
manufacturerName: ''
|
||||
},
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
chooseproducts(this.listQuery).then((response) => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.listQuery.total = response.data.total
|
||||
this.list = response.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置按钮
|
||||
handleReset() {
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.listQuery.params.goodsSpuName = ''
|
||||
this.listQuery.params.goodsSkuCode = ''
|
||||
this.listQuery.params.manufacturerName = ''
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(row) {
|
||||
this.sids = row
|
||||
},
|
||||
showData(value, createOrgSid) {
|
||||
// const aa = []
|
||||
// if (value.length > 0) {
|
||||
// for (var i = 0; i < value.length; i++) {
|
||||
// aa.push(value[i].saleVehSid)
|
||||
// }
|
||||
// this.listQuery.params.saleVehSids = aa
|
||||
// } else {
|
||||
// this.listQuery.params.saleVehSids = []
|
||||
// }``
|
||||
this.listQuery.params.createOrgSid = createOrgSid
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.getList()
|
||||
},
|
||||
// 添加修改返回
|
||||
AddUpdateReturn() {
|
||||
if (this.sids.length > 0) {
|
||||
this.$emit('backData', this.sids)
|
||||
} else {
|
||||
this.$notify({ title: '提示', message: '请至少选择一条记录进行操作', type: 'error', duration: 2000 })
|
||||
}
|
||||
},
|
||||
// 返回
|
||||
handleReturn() {
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
418
src/views/inStorage/receivingGoods/upShelfAddRecord.vue
Normal file
418
src/views/inStorage/receivingGoods/upShelfAddRecord.vue
Normal file
@@ -0,0 +1,418 @@
|
||||
<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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<!-- <div class="title">
|
||||
<div>基础信息</div>
|
||||
</div> -->
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item>
|
||||
<span class="addinputw addinputInfo">{{ formobj.createByName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单部门</div>
|
||||
<el-form-item><span class="addinputw addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 单据日期</div>
|
||||
<el-form-item prop="createTime"> <el-date-picker v-model="formobj.createTime" type="date"
|
||||
class="addinputw addinputInfo" value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||
</el-date-picker></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputw addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputw addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 上架人</div>
|
||||
<el-form-item prop="upShelfName">
|
||||
<el-select v-model="formobj.upShelfName" filterable clearable placeholder="请选择"
|
||||
class="addinputw addinputInfo" @change="allOrgperSelect">
|
||||
<el-option v-for="item in allOrgperList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
||||
type="textarea" :rows="1" clearable /></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="title">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" wid align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="doGoodsDel(scope.row.goodsSkuSid)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<!-- <el-table-column label="仓库" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseName" placeholder="请选择" clearable
|
||||
@change="selectWarehouseName(scope.row,$event)">
|
||||
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库位" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseRackName" :disabled="scope.row.warehouseName==''" clearable
|
||||
@focus="getWarehouseAreaList(scope.row.warehouseSid)" placeholder="请选择"
|
||||
@change="selectWarehouseAreaCode(scope.row,$event)">
|
||||
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batchNumber" align="center" width="300" /> -->
|
||||
<el-table-column label="需上架数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.count" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="载具编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.packageNo" clearable placeholder="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/receivingGoods.js'
|
||||
import {
|
||||
getCurrentDate
|
||||
} from '@/utils/index.js'
|
||||
import {
|
||||
selAllByOrgSidPath,
|
||||
getOrgSidByPath,
|
||||
getWarehouses,
|
||||
getWarehouseareas
|
||||
} from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"deptName": '',
|
||||
"deptSid": '',
|
||||
"sourceBillNo": "",
|
||||
"sourceBillSid": "",
|
||||
"billState": "新建",
|
||||
"upShelfSid": "",
|
||||
"upShelfName": '',
|
||||
"list": [
|
||||
|
||||
],
|
||||
"remarks": "",
|
||||
'createOrgSid': "",
|
||||
'useOrgSid': ""
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "2"
|
||||
}
|
||||
],
|
||||
supplierList: [],
|
||||
warehouseList: [],
|
||||
warehouseRackList: [],
|
||||
allOrgperList: [],
|
||||
rules: {
|
||||
createTime: [{
|
||||
required: true,
|
||||
message: '到货日期不能为空',
|
||||
trigger: 'change'
|
||||
}],
|
||||
upShelfName: [{
|
||||
required: true,
|
||||
message: '请选择上架人员',
|
||||
trigger: 'change'
|
||||
}],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getOrgPathSid() {
|
||||
getOrgSidByPath({
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.createOrgSid = res.data
|
||||
this.formobj.useOrgSid = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
doGoodsDel(sid) {
|
||||
console.log("doGoodsDel》》》》", sid)
|
||||
|
||||
this.$confirm("是否确定删除此商品?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const index = this.formobj.list.findIndex((item) => item.goodsSkuSid === sid)
|
||||
console.log("index》》》》", index)
|
||||
this.formobj.list.splice(index, 1)
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
this.submitdisabled = true
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveUpShelf(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.submitdisabled = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sid": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"createTime": getCurrentDate(),
|
||||
"deptName": '',
|
||||
"deptSid": '',
|
||||
"sourceBillNo": "",
|
||||
"sourceBillSid": "",
|
||||
"billState": "新建",
|
||||
"upShelfSid": "",
|
||||
"upShelfName": '',
|
||||
"list": [
|
||||
|
||||
],
|
||||
"remarks": "",
|
||||
'createOrgSid': "",
|
||||
'useOrgSid': ""
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
this.getWarehouseList()
|
||||
this.getAllOrgper()
|
||||
this.getOrgPathSid()
|
||||
var params = {
|
||||
sid: row.sid,
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
userSid: window.sessionStorage.getItem('userSid')
|
||||
}
|
||||
|
||||
req.initUpshelf(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
|
||||
// this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window
|
||||
// .sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
|
||||
// this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage
|
||||
// .getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
getAllOrgper() {
|
||||
selAllByOrgSidPath({
|
||||
orgSidPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.allOrgperList = res.data
|
||||
|
||||
console.log("aaaaaa", this.allOrgperList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
allOrgperSelect(val) {
|
||||
console.log("allOrgperSelect", val);
|
||||
|
||||
const choose = this.allOrgperList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
this.formobj.upShelfName = choose[0].name
|
||||
this.formobj.upShelfSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
getWarehouseList() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
getWarehouses(parpams).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getWarehouseAreaList(sid) {
|
||||
var query = {
|
||||
ckSid: sid
|
||||
}
|
||||
getWarehouseareas(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseRackList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseRackList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWarehouseName(row, val) {
|
||||
console.log("selectWarehouseName", row);
|
||||
console.log("selectWarehouseName", val);
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
row.warehouseName = choose[0].warehouseName
|
||||
row.warehouseSid = choose[0].sid
|
||||
|
||||
},
|
||||
selectWarehouseAreaCode(row, val) {
|
||||
console.log("selectWarehouseAreaCode", val);
|
||||
|
||||
const choose = this.warehouseRackList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
|
||||
row.warehouseRackName = choose[0].areaCode
|
||||
row.warehouseRackSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
352
src/views/inStorage/upShelf/index.vue
Normal file
352
src/views/inStorage/upShelf/index.vue
Normal file
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="上架单管理" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="queryParams.params.billState" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billStateList" :key="item.sid" :label="item.name" :value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">上架单列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="createTime" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人" align="center" />
|
||||
<el-table-column prop="sourceBillNo" label="来源单号" align="center" />
|
||||
<el-table-column prop="billState" label="单据状态" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/upShelf.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './upShelfAdd.vue'
|
||||
import divInfo from './upShelfInfo.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formobj: {
|
||||
sid: "",
|
||||
reviewStatus: "",
|
||||
remarks: ''
|
||||
},
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toPrintLabel',
|
||||
btnLabel: '打印标签'
|
||||
},
|
||||
// {
|
||||
// type: 'primary',
|
||||
// size: 'small',
|
||||
// icon: 'plus',
|
||||
// btnKey: 'toAdd',
|
||||
// btnLabel: '上架'
|
||||
// },
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
billNo: "",
|
||||
sourceBillNo: "",
|
||||
createTimestart: '',
|
||||
createTimeEnd: '',
|
||||
billstate: '',
|
||||
menuUrl: '',
|
||||
orgPath: '',
|
||||
usersid: ""
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: [],
|
||||
billStateList: [{
|
||||
name: "新建",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "已完成",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
sids: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
toPrintLabel() {
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toPrintLabel':
|
||||
this.toPrintLabel()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
doDel() {
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
billNo: "",
|
||||
sourceBillNo: "",
|
||||
createTimestart: '',
|
||||
createTimeEnd: '',
|
||||
billstate: '',
|
||||
menuUrl: '',
|
||||
orgPath: '',
|
||||
usersid: ""
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd(row) {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.selectionList[0].billState == '完成') {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "此记录已完成,不可操作。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showEdit(row)
|
||||
},
|
||||
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
420
src/views/inStorage/upShelf/upShelfAdd.vue
Normal file
420
src/views/inStorage/upShelf/upShelfAdd.vue
Normal file
@@ -0,0 +1,420 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>{{title}}上架单</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-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputw addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单部门</div>
|
||||
<el-form-item><span class="addinputw addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 单据日期</div>
|
||||
<el-form-item prop="createTime"> <el-date-picker v-model="formobj.createTime" type="date"
|
||||
class="addinputw addinputInfo" value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 上架人</div>
|
||||
<el-form-item prop="upShelfName">
|
||||
<el-select v-model="formobj.upShelfName" filterable clearable placeholder="请选择"
|
||||
class="addinputw addinputInfo" @change="allOrgperSelect">
|
||||
<el-option v-for="item in allOrgperList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
||||
clearable /></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="title">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" wid align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="doGoodsBatch(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
|
||||
<el-table-column label="单位" prop="unit" align="center" width="120" />
|
||||
<!-- <el-table-column label="仓库" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseName" placeholder="请选择" clearable
|
||||
@change="selectWarehouseName(scope.row,$event)">
|
||||
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库位" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.warehouseRackName" :disabled="scope.row.warehouseName==''" clearable
|
||||
@focus="getWarehouseAreaList(scope.row.warehouseSid)" placeholder="请选择"
|
||||
@change="selectWarehouseAreaCode">
|
||||
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batchNumber" align="center" width="300" /> -->
|
||||
<el-table-column label="需要上架数量" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.count" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="载具编号" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.packageNo" clearable placeholder="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/upShelf.js'
|
||||
import {
|
||||
getCurrentDate
|
||||
} from '@/utils/index.js'
|
||||
import {
|
||||
selAllByOrgSidPath,
|
||||
getWarehouses,
|
||||
getWarehouseareas
|
||||
} from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
title: "【新增】",
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"createTime": getCurrentDate(),
|
||||
"deptName": '',
|
||||
"deptSid": '',
|
||||
"sourceBillNo": "",
|
||||
"sourceBillSid": "",
|
||||
"billState": "新建",
|
||||
"upShelfSid": "",
|
||||
"upShelfName": '',
|
||||
"list": [
|
||||
|
||||
],
|
||||
"remarks": ""
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
supplierList: [],
|
||||
warehouseList: [],
|
||||
warehouseRackList: [],
|
||||
// commodity商品
|
||||
commodityKey: 1,
|
||||
commodityLoading: false,
|
||||
commodityQuery: {
|
||||
current: 1,
|
||||
size: 2,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
inOrg: "",
|
||||
outOrg: ""
|
||||
}
|
||||
},
|
||||
commodityData: [],
|
||||
isUpdata: false,
|
||||
allOrgperList: [],
|
||||
rules: {
|
||||
createTime: [{
|
||||
required: true,
|
||||
message: '到货日期不能为空',
|
||||
trigger: 'change'
|
||||
}],
|
||||
upShelfName: [{
|
||||
required: true,
|
||||
message: '请选择上架人员',
|
||||
trigger: 'change'
|
||||
}],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
|
||||
methods: {
|
||||
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
|
||||
if (this.formobj.list.length == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '请添加商品'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.formobj.list.length; i++) {
|
||||
var item = this.formobj.list[i]
|
||||
if (item.actualCount == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '商品上架数量不能为空'
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sid": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"createTime": getCurrentDate(),
|
||||
"deptName": '',
|
||||
"deptSid": '',
|
||||
"sourceBillNo": "",
|
||||
"sourceBillSid": "",
|
||||
"billState": "新建",
|
||||
"upShelfSid": "",
|
||||
"upShelfName": '',
|
||||
"list": [
|
||||
|
||||
],
|
||||
"remarks": ""
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
this.title = "【新增】"
|
||||
this.getWarehouseList()
|
||||
this.getAllOrgper()
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
this.getWarehouseList()
|
||||
this.getAllOrgper()
|
||||
this.title = "【修改】"
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
|
||||
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window
|
||||
.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1)
|
||||
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage
|
||||
.getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
||||
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
getAllOrgper() {
|
||||
selAllByOrgSidPath({
|
||||
orgSidPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.allOrgperList = res.data
|
||||
|
||||
console.log("aaaaaa", this.allOrgperList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
allOrgperSelect(val) {
|
||||
console.log("allOrgperSelect", val);
|
||||
|
||||
const choose = this.allOrgperList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
this.formobj.upShelfName = choose[0].name
|
||||
this.formobj.upShelfSid = choose[0].sid
|
||||
|
||||
},
|
||||
getWarehouseList() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
getWarehouses(parpams).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getWarehouseAreaList(sid) {
|
||||
var query = {
|
||||
ckSid: sid
|
||||
}
|
||||
getWarehouseareas(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseRackList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseRackList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWarehouseName(row, val) {
|
||||
console.log("selectWarehouseName", row);
|
||||
console.log("selectWarehouseName", val);
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
row.warehouseName = choose[0].warehouseName
|
||||
row.warehouseSid = choose[0].sid
|
||||
|
||||
},
|
||||
selectWarehouseAreaCode(val) {
|
||||
console.log("selectWarehouseAreaCode", val);
|
||||
|
||||
const choose = this.warehouseRackList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
|
||||
row.warehouseRackName = choose[0].areaCode
|
||||
row.warehouseRackSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
161
src/views/inStorage/upShelf/upShelfInfo.vue
Normal file
161
src/views/inStorage/upShelf/upShelfInfo.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>上架单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty">制单部门</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">上架人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.upShelfName }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="title">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="listLoading" :data="formobj.list" border>
|
||||
<el-table-column fixed label="序号" type="index" :index="indexMethod" align="center" width="80" />
|
||||
<el-table-column fixed label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<!-- <el-table-column label="批次号" prop="batchNumber" align="center" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" />
|
||||
<el-table-column label="库位" prop="warehouseRackCode" align="center" /> -->
|
||||
<el-table-column label="需上架数量" prop="count" align="center" />
|
||||
<el-table-column label="已上架数量" prop="actualCount" align="center" />
|
||||
<el-table-column label="未上架数量" prop="noShelfCount" align="center" />
|
||||
<el-table-column label="载具编号" prop="packageNo" align="center" />
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/inStorage/upShelf.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
48
src/views/index.vue
Normal file
48
src/views/index.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div class="imgDemo">
|
||||
<!--<el-button type="primary" @click="getToken()">token</el-button>
|
||||
<div style="width: 200px;">{{token}}</div>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {login1} from '@/api/system/user/login.js'
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
token1:'',
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.token1 = window.sessionStorage.getItem('token');
|
||||
console.log("tokenName2222", this.token1)
|
||||
},
|
||||
methods:{
|
||||
// getToken(){
|
||||
// let params = {
|
||||
// password: "329653",
|
||||
// roleSid: "",
|
||||
// token: "",
|
||||
// userName: "15097329653",
|
||||
// verifyCode: ""
|
||||
// }
|
||||
// login1(params).then(res => {
|
||||
// this.token = res.data.token
|
||||
// window.sessionStorage.setItem('token', res.data.token)
|
||||
// })
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.imgDemo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: radial-gradient(#fff,#f5f7f4, #fff);
|
||||
}
|
||||
canvas {
|
||||
}
|
||||
</style>
|
||||
862
src/views/login/login.vue
Normal file
862
src/views/login/login.vue
Normal file
@@ -0,0 +1,862 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<div class="logoTitle" style="margin-left: 50px;margin-top: 50px;">
|
||||
<img src="../../assets/loginImg/yxt-logo.png" style="width: 250px;height:50px; margin-right: 10px;" />
|
||||
</div>
|
||||
|
||||
<div class="main">
|
||||
|
||||
<img src="../../assets/loginImg/login_left.png" style="width:50%;height:100%; " />
|
||||
|
||||
<div class="main-right" v-show="register==0">
|
||||
|
||||
<span class="main-right-title">欢迎登录商享通OMS</span>
|
||||
|
||||
|
||||
<div class="main-right-table">
|
||||
|
||||
<div :class="tableIndex == 1 ? 'main-right-table-text1' : 'main-right-table-text3'" @click="tableClick(1)">
|
||||
密码登录</div>
|
||||
<div :class="tableIndex == 2 ? 'main-right-table-text2' : 'main-right-table-text4'" @click="tableClick(2)">
|
||||
验证码登录</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="main-right-table-password" v-show="tableIndex==1">
|
||||
|
||||
<el-input class="input" placeholder="请输入手机号/邮箱" clearable v-model="loginForm.userName" />
|
||||
<el-input class="input" placeholder="请输入密码" type="password" show-password v-model="loginForm.password" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="main-right-table-code" v-show="tableIndex==2">
|
||||
<el-input class="input" placeholder="请输入手机号/邮箱" clearable v-model="loginForm.userName" />
|
||||
<div style="display: flex;flex-direction: row;align-items: center;width: 100%;">
|
||||
<el-input class="input" style="flex: 1; margin-right: 10px;" maxlength="6" placeholder="请输入验证码"
|
||||
v-model="loginForm.verifyCode" />
|
||||
<span :class="sendCodeType ? 'sendCode1' : 'sendCode2'" @click="sendCode">{{sendCodeText}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<el-button type="primary" size="small" style="width: 65%;margin-top: 30px; font-size: 25px;line-height: 40px;"
|
||||
@click="login">登录</el-button>
|
||||
|
||||
<div class="main-right-bom">
|
||||
|
||||
<el-checkbox class="main-right-bom-left" v-model="checkbox">7天内免登录</el-checkbox>
|
||||
|
||||
<div class="main-right-bom-right">
|
||||
|
||||
<span @click="forgetClick">忘记密码</span>
|
||||
<div style="margin-left: 8px;margin-right: 8px;width: 1px; height: 18px;background: #999;"></div>
|
||||
<span @click="registerClick">去注册</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="main-right" v-show="register==1">
|
||||
|
||||
<div v-show="registerStep==1" class="registerStep1">
|
||||
<span class="main-right-title2">欢迎注册商享通OMS</span>
|
||||
|
||||
|
||||
<span style="width: 100%; margin-top: 15px;">手机号码</span>
|
||||
|
||||
<el-input class="input" style="flex: 1; margin-right: 10px;margin-top: 5px;" maxlength="11"
|
||||
placeholder="请输入手机号码" v-model="registerInfo.mobile" />
|
||||
|
||||
<span style="width: 100%;margin-top: 15px;">密码</span>
|
||||
|
||||
<el-input class="input" style="flex: 1; margin-right: 10px;margin-top: 5px;" maxlength="6" placeholder="请输入密码"
|
||||
v-model="registerInfo.password" show-password />
|
||||
|
||||
<span style="width: 100%;margin-top: 15px;">验证码</span>
|
||||
<div
|
||||
style="display: flex;flex-direction: row;align-items: center;width: 100%; margin-top: 5px;margin-left: -10px;">
|
||||
<el-input class="input" style="flex: 1; margin-right: 10px;" maxlength="6" placeholder="请输入验证码"
|
||||
v-model="registerInfo.code" />
|
||||
<span :class="sendCodeType2 ? 'sendCode1' : 'sendCode2'" @click="sendCode2">{{sendCodeText2}}</span>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;align-items: center;width: 100%; margin-top: 5px;"
|
||||
@click="goLogin">
|
||||
<span>已有账号?</span>
|
||||
<span style="color: #5084D2;">登录</span>
|
||||
</div>
|
||||
|
||||
|
||||
<el-button type="primary" size="small"
|
||||
style="width: 100%;margin-top: 30px; font-size: 25px;line-height: 40px;"
|
||||
@click="registerStep1()">注册</el-button>
|
||||
|
||||
<div style="display: flex;flex-direction: row;align-items: center;width: 100%; margin-top: 10px;">
|
||||
<el-checkbox style="margin-right: 5px;" v-model="check"></el-checkbox>
|
||||
<span style="font-size: 12px;">我已阅读并同意</span>
|
||||
<span style="font-size: 12px;">《宇信通服务协议》</span>
|
||||
<span style="font-size: 12px;">与</span>
|
||||
<span style="font-size: 12px;">《隐私协议》</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="registerStep==2" class="registerStep2">
|
||||
|
||||
<span class="main-right-title">请选择公司进入OMS</span>
|
||||
|
||||
<div style="height: 300px;width: 100%; margin-top: 15px;overflow: auto;
|
||||
display: flex;flex-direction: column;">
|
||||
|
||||
<div v-for="(item,index) in companyList" :key="index" @click="itemClick(item)"
|
||||
style="display: flex;flex-direction: column;width: 100%;">
|
||||
<div style="display: flex;flex-direction: row;align-items: center;
|
||||
background: #EDF1F7; border-radius: 8px;width: 100%;margin-bottom: 20px;
|
||||
height: 50px;">
|
||||
<img src="../../assets/images/company_icon.png" style="width: 25px; height: 25px;
|
||||
margin-left: 10px;margin-right: 10px;" />
|
||||
<span style="flex: 1;margin-right: 10px;">{{item.orgName}}</span>
|
||||
<img v-show="item.type=='1'" src="../../assets/images/overdue.png" style=" height: 100%;" />
|
||||
<img v-show="item.type=='2'" src="../../assets/images/experience.png" style=" height: 100%;" />
|
||||
<img v-show="item.type=='3'" src="../../assets/images/formal.png" style=" height: 100%;" />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<el-button type="primary" size="small"
|
||||
style="width: 100%;margin-top: 30px; font-size: 25px;line-height: 40px;"
|
||||
@click="registerStep2()">新建企业信息</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-show="registerStep==3" class="registerStep3">
|
||||
|
||||
<span class="main-right-title2">欢迎注册商享通OMS</span>
|
||||
|
||||
<span style="width: 100%; font-size: 16px;color: #000; margin-top: 40px;">请填写您的企业信息</span>
|
||||
|
||||
<div style="display: flex;flex-direction: row;align-items: center; margin-top: 15px;width: 100%; ">
|
||||
<span>企业名称:</span>
|
||||
<el-input class="input" style="flex: 1; " placeholder="请输入公司名称" v-model="registerInfo.companyName" />
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;width: 100%; ">
|
||||
<span>联系人员:</span>
|
||||
<el-input class="input" style="flex: 1;" placeholder="请输入联系人" v-model="registerInfo.contacts" />
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;width: 100%; ">
|
||||
<span>所在区域:</span>
|
||||
<!-- <el-input class="input" style="flex: 1; margin-right: 10px;" placeholder="请输入公司名称"
|
||||
v-model="registerInfo.company" /> -->
|
||||
|
||||
<el-cascader v-model="selectedOptions" :options="options" filterable clearable class="input"
|
||||
style="flex: 1;" @change="handleChange" />
|
||||
|
||||
</div>
|
||||
<el-button type="primary" size="small"
|
||||
style="width: 100%;margin-top: 30px; font-size: 25px;line-height: 40px;"
|
||||
@click="registerStep3()">创建并进入</el-button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
doLogin,
|
||||
registerSendMessageCode,
|
||||
bindOrganization,
|
||||
selOrganization,
|
||||
getUserById,
|
||||
registUser
|
||||
} from '@/api/user.js'
|
||||
// 导入省市区数据组件
|
||||
import {
|
||||
regionData,
|
||||
codeToText,
|
||||
TextToCode
|
||||
} from 'element-china-area-data'
|
||||
import {
|
||||
setCookie,
|
||||
getCookie,
|
||||
removeCookie,
|
||||
} from '@/utils/functions.js.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
checkbox: false,
|
||||
register: 0,
|
||||
registerStep: 1,
|
||||
tableIndex: 1,
|
||||
|
||||
sendCodeText: "发送验证码",
|
||||
sendCodeType: false,
|
||||
totalTime: 10, //一般是60
|
||||
timer: '', //定时器
|
||||
|
||||
sendCodeText2: "发送验证码",
|
||||
sendCodeType2: false,
|
||||
totalTime2: 10, //一般是60
|
||||
timer2: '', //定时器
|
||||
|
||||
check: false,
|
||||
registerInfo: {
|
||||
mobile: '',
|
||||
userSid: ""
|
||||
},
|
||||
loginForm: {
|
||||
userName: '',
|
||||
password: '',
|
||||
verifyCode: "",
|
||||
type: "1"
|
||||
},
|
||||
loading: false,
|
||||
loginCode: false,
|
||||
showMsg: false,
|
||||
forgetPwd: false,
|
||||
nopassword: {
|
||||
userPhone: '',
|
||||
userName: '',
|
||||
},
|
||||
// 将省市区数据赋给级联选择器
|
||||
options: regionData,
|
||||
// 存放用户选择后省市区的信息
|
||||
selectedOptions: [],
|
||||
companyList: [
|
||||
// {
|
||||
// sid: "1",
|
||||
// name: "撒打算打算1阿斯顿撒大撒打算打算大萨达",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "2",
|
||||
// name: "撒打算打算2",
|
||||
// type: "2"
|
||||
// }, {
|
||||
// sid: "3",
|
||||
// name: "撒打算打算3",
|
||||
// type: "3"
|
||||
// }, {
|
||||
// sid: "4",
|
||||
// name: "撒打算打算4",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "5",
|
||||
// name: "撒打算打算5",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "6",
|
||||
// name: "撒打算打算6",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "7",
|
||||
// name: "撒打算打算7",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "1",
|
||||
// name: "撒打算打算1",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "1",
|
||||
// name: "撒打算打算1",
|
||||
// type: "1"
|
||||
// }, {
|
||||
// sid: "1",
|
||||
// name: "撒打算打算1",
|
||||
// type: "1"
|
||||
// },
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
if (getCookie("pas") && getCookie("name")) { //判断页面是否有对应Cookie
|
||||
this.loginForm.userName = getCookie("name"); //有则写入
|
||||
this.loginForm.password = getCookie("pas");
|
||||
|
||||
console.log(" created", this.loginForm)
|
||||
|
||||
this.checkbox = true
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
this.loginForm.userName = ""; //无则写空
|
||||
this.loginForm.password = "";
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 省市区级联选择器选择后更新用户前端
|
||||
handleChange(value) {
|
||||
console.log(" handleChange", value)
|
||||
|
||||
var province = ''
|
||||
var city = ''
|
||||
var country = ''
|
||||
for (let i = 0; i < this.selectedOptions.length; i++) {
|
||||
if (i === 0) {
|
||||
var province = codeToText[this.selectedOptions[i]]
|
||||
}
|
||||
if (i === 1) {
|
||||
var city = codeToText[this.selectedOptions[i]]
|
||||
}
|
||||
if (i === 2) {
|
||||
var country = codeToText[this.selectedOptions[i]]
|
||||
}
|
||||
}
|
||||
|
||||
console.log(" handleChange", province + "/" + city + "/" + country)
|
||||
|
||||
this.registerInfo.region = province + "/" + city + "/" + country
|
||||
|
||||
},
|
||||
tableClick(index) {
|
||||
this.tableIndex = index
|
||||
|
||||
this.loginForm.type = index + ""
|
||||
|
||||
},
|
||||
|
||||
// 验证码倒计时
|
||||
sendCode() {
|
||||
if (this.sendCodeType) return
|
||||
// this.getCode() // 获取验证码的接口
|
||||
this.sendCodeType = true
|
||||
this.sendCodeText = this.totalTime + 's'
|
||||
this.timer = setInterval(() => {
|
||||
this.totalTime--
|
||||
this.sendCodeText = this.totalTime + 's'
|
||||
if (this.totalTime < 0) {
|
||||
clearInterval(this.timer)
|
||||
this.sendCodeText = '发送验证码'
|
||||
this.totalTime = 10
|
||||
this.sendCodeType = false
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
// 验证码倒计时
|
||||
sendCode2() {
|
||||
|
||||
if (this.registerInfo.mobile == '') {
|
||||
this.$message({
|
||||
message: '请输入手机号码',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
|
||||
|
||||
console.log(" reg", reg.test(this.registerInfo.mobile))
|
||||
|
||||
if (!reg.test(this.registerInfo.mobile)) {
|
||||
this.$message({
|
||||
message: '手机号码格式错误',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.sendCodeType2) return
|
||||
// this.getCode() // 获取验证码的接口
|
||||
this.sendCodeType2 = true
|
||||
this.sendCodeText2 = this.totalTime2 + 's'
|
||||
this.timer2 = setInterval(() => {
|
||||
this.totalTime2--
|
||||
this.sendCodeText2 = this.totalTime2 + 's'
|
||||
if (this.totalTime2 < 0) {
|
||||
clearInterval(this.timer2)
|
||||
this.sendCodeText2 = '发送验证码'
|
||||
this.totalTime2 = 10
|
||||
this.sendCodeType2 = false
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
registerSendMessageCode(this.registerInfo.mobile).then((response) => {}).catch(() => {})
|
||||
|
||||
},
|
||||
|
||||
login() {
|
||||
|
||||
if (this.checkbox) { //判断多选框是否选中
|
||||
setCookie("name", this.loginForm.userName, 7); //如选中则添加Cookie,添加内容为用户输入的密码和用户名
|
||||
setCookie("pas", this.loginForm.password, 7);
|
||||
} else {
|
||||
removeCookie("name"); //如没选中,则删除掉对应的Cookie
|
||||
removeCookie("pas");
|
||||
}
|
||||
|
||||
// this.register = 1
|
||||
// this.registerStep = 2
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
doLogin(this.loginForm).then((response) => {
|
||||
if (response.code == 200) {
|
||||
|
||||
loading.close()
|
||||
this.register = 1
|
||||
|
||||
this.companyList = response.data.sysOrganizationVos
|
||||
this.registerInfo.userSid = response.data.sid
|
||||
|
||||
if (this.companyList.length == 0) {
|
||||
// 1. 新用户 无关联企业
|
||||
this.registerStep = 3
|
||||
} else {
|
||||
// 2. 注册过 选择企业登录
|
||||
this.registerStep = 2
|
||||
}
|
||||
} else {
|
||||
loading.close()
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
},
|
||||
forgetClick() {
|
||||
|
||||
},
|
||||
registerClick() {
|
||||
this.register = 1
|
||||
this.registerStep = 1
|
||||
},
|
||||
goLogin() {
|
||||
this.register = 0
|
||||
this.registerStep = 0
|
||||
},
|
||||
registerStep1() {
|
||||
|
||||
if (!this.check) {
|
||||
this.$message({
|
||||
message: '请阅读并同意《宇信通服务协议》与《隐私协议》',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
registUser(this.registerInfo).then((response) => {
|
||||
if (response.code == 200) {
|
||||
loading.close()
|
||||
|
||||
this.companyList = response.data.sysOrganizationVos
|
||||
this.registerInfo.userSid = response.data.sid
|
||||
|
||||
if (this.companyList.length == 0) {
|
||||
// 1. 新用户 无关联企业
|
||||
this.registerStep = 3
|
||||
} else {
|
||||
// 2. 注册过 选择企业登录
|
||||
this.registerStep = 2
|
||||
}
|
||||
|
||||
} else {
|
||||
loading.close()
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
},
|
||||
registerStep2() {
|
||||
|
||||
this.registerStep = 3
|
||||
|
||||
},
|
||||
registerStep3() {
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
bindOrganization(this.registerInfo).then((response) => {
|
||||
|
||||
if (response.code == 200) {
|
||||
|
||||
this.$router.push({
|
||||
path: '/index'
|
||||
})
|
||||
|
||||
loading.close()
|
||||
|
||||
|
||||
window.sessionStorage.setItem('token', response.data.token)
|
||||
window.sessionStorage.setItem('userSid', response.data.sid)
|
||||
window.sessionStorage.setItem('staffSid', response.data.staffSid)
|
||||
window.sessionStorage.setItem('userName', response.data.userName)
|
||||
window.sessionStorage.setItem('orgName', response.data.orgName)
|
||||
window.sessionStorage.setItem('mobile', response.data.mobile)
|
||||
window.sessionStorage.setItem('orgSid', response.data.orgSid)
|
||||
window.sessionStorage.setItem('departmentName', response.data.departmentName)
|
||||
window.sessionStorage.setItem('departmentSid', response.data.departmentSid)
|
||||
window.sessionStorage.setItem('defaultOrgPath', response.data.orgSid)
|
||||
window.sessionStorage.setItem('orgNamePath', response.data.orgNamePath)
|
||||
window.sessionStorage.setItem('orgSidPath', response.data.orgSidPath)
|
||||
window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', response.data
|
||||
.pNameAndDepartmentNameAndPostName)
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
},
|
||||
itemClick(item) {
|
||||
console.log(" itemClick", item)
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
var params = {
|
||||
userSid: this.registerInfo.userSid,
|
||||
orgSid: item.orgSid
|
||||
}
|
||||
|
||||
selOrganization(params).then((response) => {
|
||||
|
||||
if (response.code == 200) {
|
||||
|
||||
this.$router.push({
|
||||
path: '/index'
|
||||
})
|
||||
|
||||
loading.close()
|
||||
|
||||
window.sessionStorage.setItem('token', response.data.token)
|
||||
window.sessionStorage.setItem('userSid', response.data.sid)
|
||||
window.sessionStorage.setItem('staffSid', response.data.staffSid)
|
||||
window.sessionStorage.setItem('userName', response.data.userName)
|
||||
window.sessionStorage.setItem('orgName', response.data.orgName)
|
||||
window.sessionStorage.setItem('mobile', response.data.mobile)
|
||||
window.sessionStorage.setItem('orgSid', response.data.orgSid)
|
||||
window.sessionStorage.setItem('departmentName', response.data.departmentName)
|
||||
window.sessionStorage.setItem('departmentSid', response.data.departmentSid)
|
||||
window.sessionStorage.setItem('defaultOrgPath', response.data.orgSid)
|
||||
window.sessionStorage.setItem('orgNamePath', response.data.orgNamePath)
|
||||
window.sessionStorage.setItem('orgSidPath', response.data.orgSidPath)
|
||||
window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', response.data
|
||||
.pNameAndDepartmentNameAndPostName)
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
getUserInfo(id) {
|
||||
getUserById(id).then((response) => {
|
||||
if (response.code == 200) {
|
||||
console.log(" response", response)
|
||||
let user = response.data
|
||||
// 结果存入缓存
|
||||
window.sessionStorage.setItem('staffSid', user.staffSid)
|
||||
window.sessionStorage.setItem('sid', user.sid)
|
||||
window.sessionStorage.setItem('userName', user.userName)
|
||||
}
|
||||
|
||||
}).catch(() => {})
|
||||
|
||||
},
|
||||
codeShow() {
|
||||
if (this.loginForm.password == '' || this.loginForm.userName == '') {
|
||||
this.loginCode = false
|
||||
this.showMsg = true
|
||||
return
|
||||
}
|
||||
this.$refs.imgCodeRole.getCodeImage()
|
||||
},
|
||||
reGetPwd() {
|
||||
user.reGetPwd(this.nopassword).then((res) => {})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
// .el-input__inner {
|
||||
// border: none;
|
||||
// color: #000;
|
||||
// font-size: 16px;
|
||||
// }
|
||||
|
||||
input:-webkit-autofill {
|
||||
-webkit-box-shadow: 0 0 0px 1000px white inset;
|
||||
-webkit-text-fill-color: #000;
|
||||
}
|
||||
|
||||
|
||||
.login {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: 100% 100%;
|
||||
background-image: url(../../assets/home/bj.png);
|
||||
background-position: center;
|
||||
overflow: hidden;
|
||||
|
||||
.logoTitle {
|
||||
margin: 30px;
|
||||
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 60%;
|
||||
height: 500px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 13px 12px 0px rgba(0, 0, 0, 0.15);
|
||||
opacity: 0.8;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
right: 20%;
|
||||
top: 25%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.main-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
|
||||
.main-right-title {
|
||||
margin-top: 40px;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.main-right-title2 {
|
||||
margin-top: 40px;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #467CCF;
|
||||
}
|
||||
|
||||
.main-right-table {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 30px;
|
||||
width: 70%;
|
||||
|
||||
.main-right-table-text1 {
|
||||
flex: 1;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
color: #3E77CD;
|
||||
}
|
||||
|
||||
.main-right-table-text1:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 60px;
|
||||
border-bottom: 2px solid #3E77CD;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
.main-right-table-text3 {
|
||||
flex: 1;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
border-bottom: none;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.main-right-table-text2 {
|
||||
flex: 1;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
color: #3E77CD;
|
||||
}
|
||||
|
||||
.main-right-table-text2:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 80px;
|
||||
border-bottom: 2px solid #3E77CD;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.main-right-table-text4 {
|
||||
flex: 1;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
border-bottom: none;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.main-right-table-password {
|
||||
display: flex;
|
||||
width: 65%;
|
||||
margin-top: 10px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.input {
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
.main-right-table-code {
|
||||
|
||||
display: flex;
|
||||
width: 65%;
|
||||
margin-top: 10px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.input {
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.sendCode1 {
|
||||
font-size: 16px;
|
||||
color: #c9c9c9;
|
||||
}
|
||||
|
||||
.sendCode2 {
|
||||
font-size: 16px;
|
||||
color: #3E77CD;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.main-right-bom {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
display: flex;
|
||||
width: 65%;
|
||||
margin-top: 10px;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.main-right-bom-left {
|
||||
color: #000;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-right-bom-right {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.registerStep1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 65%;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.main-right-title2 {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #467CCF;
|
||||
}
|
||||
|
||||
.sendCode1 {
|
||||
font-size: 16px;
|
||||
color: #c9c9c9;
|
||||
}
|
||||
|
||||
.sendCode2 {
|
||||
font-size: 16px;
|
||||
color: #3E77CD;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.registerStep2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 70%;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.main-right-title {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.registerStep3 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 70%;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
291
src/views/outStorage/distributionAdd.vue
Normal file
291
src/views/outStorage/distributionAdd.vue
Normal file
@@ -0,0 +1,291 @@
|
||||
<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-form ref="form_obj" :model="formobj" label-position="top" label-width="190px" class="formadd">
|
||||
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据编号</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.billNo}}</span>
|
||||
<!-- <el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%" clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">制单人姓名</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.createByName}}</span>
|
||||
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
|
||||
clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">外部单号</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.sourceBillNo}}</span>
|
||||
<!-- <el-form-item class="trightb_item">
|
||||
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
|
||||
@change="orderTypeSelect">
|
||||
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据日期</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<!-- <span slot="label">{{formobj.createTime}}</span> -->
|
||||
<el-date-picker v-model="formobj.createTime" type="date" style="width:100%" value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<!-- <el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
|
||||
@change="businessTypeSelect">
|
||||
<el-option v-for="item in businessTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">单据状态</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">{{formobj.billState}}</span>
|
||||
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
|
||||
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" class="trightb">
|
||||
<el-form-item class="trightb_item">
|
||||
<span slot="label">备注</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item class="trightb_item">
|
||||
<!-- <span slot="label">{{formobj.remarks}}</span> -->
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw"
|
||||
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="1" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="title"
|
||||
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border style="width: 100%;"
|
||||
:row-style="{height: '40px'}">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toDel(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" />
|
||||
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
|
||||
<el-table-column label="配货数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.distributeCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/outStorage.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sourceBillSid": "",
|
||||
"sourceBillNo": "",
|
||||
"billNo": "",
|
||||
"createByName": "",
|
||||
"billState": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sourceBillSid": "",
|
||||
"sourceBillNo": "",
|
||||
"billNo": "",
|
||||
"createByName": "",
|
||||
"billState": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.initDistribution(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
toDel(index) {
|
||||
const tip = '请确认是否删除所选商品?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.formobj.detailsList.splice(index, 1)
|
||||
|
||||
|
||||
}).catch(() => {})
|
||||
},
|
||||
saveOrUpdate(){
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.saveDistribution(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.trightb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.trightb_item {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.span {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-left: 50px;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
border: 1px #fff solid;
|
||||
padding: 0px 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::v-deep .el-collapse-item__header {
|
||||
height: 40px;
|
||||
padding: 10px;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
color: #ffffff;
|
||||
background-color: #0294d7;
|
||||
}
|
||||
|
||||
::v-deep .el-collapse-item__content {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
336
src/views/outStorage/index.vue
Normal file
336
src/views/outStorage/index.vue
Normal file
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="出库单管理" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select v-model="queryParams.params.billState" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billStateList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">出库单列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="createTime" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人" align="center" />
|
||||
<el-table-column prop="sourceBillNo" label="来源单号" align="center" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
|
||||
<el-table-column prop="billState" label="单据状态" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<divInfo v-show="viewState==4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './outStorageAdd.vue'
|
||||
import divInfo from './outStorageInfo.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"billNo": "",
|
||||
"sourceBillNo": "",
|
||||
"busTypeValue": "",
|
||||
"billState": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
},
|
||||
billStateList: [{
|
||||
name: "新建",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "完成",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
|
||||
// this.viewState = 5
|
||||
// this.$refs['distributionAdd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toInfo(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divInfo'].showEdit(row)
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
509
src/views/outStorage/outStorageAdd.vue
Normal file
509
src/views/outStorage/outStorageAdd.vue
Normal file
@@ -0,0 +1,509 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>{{title}}出库单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit">确认</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据编号</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.billNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><el-date-picker v-model="formobj.createTime" type="date" class="addinputInfo addinputw"
|
||||
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><el-select v-model="formobj.busTypeValue" filterable clearable placeholder="请选择"
|
||||
class="addinputInfo addinputw" @change="busTypeSelect">
|
||||
<el-option v-for="item in busTypeList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo addinputw">{{ formobj.billState }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputInfo addinputw"
|
||||
type="textarea" :rows="4" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<div class="title titleOne">
|
||||
<div>商品列表</div>
|
||||
<el-button type="primary" size="small" class="btntopblueline" @click="selectProducts">选择商品</el-button>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="small" @click="commodityDelete(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" width="100" :render-header="commodityHeader">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="900" trigger="click">
|
||||
<div>
|
||||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
|
||||
@current-change="commodityCurrentChange($event, scope.row)">
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
</el-table>
|
||||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
|
||||
layout="total, pager" :total="commodityQuery.total" />
|
||||
</div>
|
||||
<el-input slot="reference" v-model="scope.row.goodsSpuName"
|
||||
@input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="商品ID" prop="goodsID" align="center" />
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="仓库" prop="warehouseName" align="center" />
|
||||
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
|
||||
<el-table-column label="销售单价" prop="money" align="center" />
|
||||
<el-table-column label="出库数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" v-model="scope.row.outCount"
|
||||
@input="commodityComputeYHAndXSJE(scope.row,$event)" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" prop="moneyAll" align="center" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 选择商品 -->
|
||||
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
import chooseproducts from './relation/chooseproducts'
|
||||
export default {
|
||||
components: {
|
||||
chooseproducts
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewState: 1,
|
||||
title: '【新增】',
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sourceBillNo": "",
|
||||
"createByName": window.sessionStorage.getItem('name'),
|
||||
"busTypeKey": "",
|
||||
"busTypeValue": "",
|
||||
"billState": '新建',
|
||||
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"sid": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
// // commodity商品
|
||||
// commodityKey: 1,
|
||||
// commodityLoading: false,
|
||||
// commodityQuery: {
|
||||
// current: 1,
|
||||
// size: 2,
|
||||
// total: 0,
|
||||
// params: {
|
||||
// name: '',
|
||||
// inOrg: "",
|
||||
// outOrg: ""
|
||||
// }
|
||||
// },
|
||||
// commodityData: [],
|
||||
isUpdata: false
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
backData(value) {
|
||||
this.viewState = 1
|
||||
if (value.length > 0) {
|
||||
value.forEach((e) => {
|
||||
|
||||
this.formobj.detailsList.push({
|
||||
goodSpuSid: e.goodsSpuSid,
|
||||
goodsSpuName: e.goodsSpuName,
|
||||
goodsSkuSid: e.goodsSkuSid,
|
||||
goodsSkuTitle: e.goodsSkuTitle,
|
||||
goodsSkuCode: e.goodsSkuCode,
|
||||
goodsSkuOwnSpec: e.goodsSkuOwnSpec,
|
||||
unit: e.unit,
|
||||
warehouseSid: e.warehouseSid,
|
||||
warehouseName: e.warehouseName,
|
||||
warehouseRackSid: e.warehouseRackSid,
|
||||
warehouseRackCode: e.warehouseRackCode,
|
||||
money: e.money,
|
||||
moneyAll: '',
|
||||
outCount: '',
|
||||
inventorySid: e.inventorySid, // 库存商品sid
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
selectProducts() {
|
||||
this.viewState = 2
|
||||
const aa = []
|
||||
this.$refs['divSp'].showData(aa, this.formobj.createOrgSid)
|
||||
},
|
||||
|
||||
// commodityInput(value) {
|
||||
// this.commodityQuery.params.name = value
|
||||
// this.commodityLoading = true
|
||||
// req.getGoodsListPage(this.commodityQuery).then((response) => {
|
||||
// if (response.success) {
|
||||
// this.commodityLoading = false
|
||||
// this.commodityData = response.data.records
|
||||
// this.commodityQuery.total = response.data.total
|
||||
// } else {
|
||||
// this.serviceLoading = false
|
||||
// this.commodityData = []
|
||||
// this.commodityQuery.total = 0
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// commodityDelete(index) {
|
||||
// this.formobj.detailsList.splice(index, 1)
|
||||
// },
|
||||
// commodityCurrentChange(value, row) {
|
||||
// console.log("commodityCurrentChange》》》》", value)
|
||||
// console.log("commodityCurrentChange》》》》", row)
|
||||
// row.inventorySid = value.inventorySid
|
||||
// row.goodSpuSid = value.goodSpuSid
|
||||
// row.goodsSkuSid = value.goodsSkuSid
|
||||
// row.goodsSkuTitle = value.goodsSkuTitle
|
||||
// row.goodsSpuName = value.goodsSpuName
|
||||
// row.goodsSkuCode = value.goodsSkuCode
|
||||
// row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
|
||||
// row.unit = value.unit
|
||||
// row.warehouseSid = value.warehouseSid
|
||||
// row.warehouseName = value.warehouseName
|
||||
// row.warehouseRackSid = value.warehouseRackSid
|
||||
// row.warehouseRackCode = value.warehouseRackCode
|
||||
// row.money = value.money
|
||||
// row.moneyAll = 0
|
||||
// row.outCount = 0
|
||||
// document.body.click()
|
||||
// },
|
||||
|
||||
// // 在头部标题上添加“新增”图标
|
||||
// commodityHeader(h, {
|
||||
// column
|
||||
// }) {
|
||||
// return h(
|
||||
// 'div',
|
||||
// [
|
||||
// h('span', column.label),
|
||||
// h('i', {
|
||||
// class: 'add-btn-icon el-icon-plus',
|
||||
// style: 'color: red;font-size:20px',
|
||||
// on: {
|
||||
// click: this.commodityAdd // 点击执行函数
|
||||
// }
|
||||
// })
|
||||
// ]
|
||||
// )
|
||||
// },
|
||||
// commodityAdd() {
|
||||
// this.formobj.detailsList.push({
|
||||
// "inventorySid": "",
|
||||
// "goodSpuSid": "",
|
||||
// "goodsSpuName": "",
|
||||
// "goodsSkuSid": "",
|
||||
// "goodsSkuTitle": "",
|
||||
// "goodsSkuCode": "",
|
||||
// "goodsSkuOwnSpec": "",
|
||||
// "unit": "",
|
||||
// "warehouseSid": "",
|
||||
// "warehouseName": "",
|
||||
// "warehouseRackSid": "",
|
||||
// "warehouseRackCode": "",
|
||||
// "money": 0,
|
||||
// "moneyAll": 0,
|
||||
// "outCount": 0
|
||||
// })
|
||||
// },
|
||||
indexMethod(index) {
|
||||
return Number(index) + 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
|
||||
if (this.formobj.createByName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '制单人不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.createTime == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '单据日期不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.busTypeKey == '' || this.formobj.busTypeValue == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '单据类型不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.detailsList.length == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品列表不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.formobj.detailsList.length; i++) {
|
||||
var item = this.formobj.detailsList[i]
|
||||
|
||||
|
||||
if (item.goodSpuSid == '' || item.goodsSpuName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品名称不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (item.goodsSkuCode == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '商品编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (item.outCount == 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '出库数量不能为0'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.submit(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sourceBillNo": "",
|
||||
"createByName": "",
|
||||
"busTypeKey": "",
|
||||
"busTypeValue": "",
|
||||
"billState": '新建',
|
||||
"createOrgSid": "",
|
||||
"useOrgSid": "",
|
||||
"sid": "",
|
||||
"createBySid": "",
|
||||
"createTime": "",
|
||||
"remarks": "",
|
||||
"detailsList": [
|
||||
|
||||
]
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.isUpdata = false
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
this.title = "【新增】"
|
||||
this.isUpdata = false
|
||||
},
|
||||
showEdit(row) {
|
||||
this.title = "【修改】"
|
||||
this.isUpdata = true
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
|
||||
req.init(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
},
|
||||
busTypeSelect(val) {
|
||||
const choose = this.busTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>busTypeSelect', choose)
|
||||
this.formobj.busTypeKey = choose[0].sid
|
||||
this.formobj.busTypeValue = choose[0].name
|
||||
|
||||
},
|
||||
commodityComputeYHAndXSJE(row, val) {
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
|
||||
row.moneyAll = (Number(row.money) * Number(row.outCount)).toFixed(2)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo addinputw {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
152
src/views/outStorage/outStorageInfo.vue
Normal file
152
src/views/outStorage/outStorageInfo.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
outStorage<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>出库单</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据编号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">制单人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据日期</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">来源单号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">业务类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">单据状态</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billState }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<div class="title">
|
||||
<div>商品列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.detailsList" border>
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
|
||||
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
|
||||
<el-table-column label="单位" prop="unit" align="center" />
|
||||
<el-table-column label="出库数量" prop="outCount" align="center" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/outStorage/outStorage.js'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
submitdisabled: false,
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
|
||||
var params = {
|
||||
sid: row.sid
|
||||
}
|
||||
req.init(params)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = {}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
164
src/views/outStorage/relation/chooseproducts.vue
Normal file
164
src/views/outStorage/relation/chooseproducts.vue
Normal file
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<div class="tab-header webtop">
|
||||
<div>选择商品</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<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="120px" class="tab-header">
|
||||
<el-form-item label="商品名称" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" class="searchlist">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" class="searchlist">
|
||||
<el-input v-model="listQuery.params.manufacturerName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</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 :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column width="50px" type="selection" align="center"/>
|
||||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="indexes" label="规格" align="center" />
|
||||
<el-table-column prop="goodsUnitName" label="单位" align="center" />
|
||||
<el-table-column prop="manufacturerName" label="供应商" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<Pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import { chooseproducts } from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'SelectVehicle',
|
||||
components: {
|
||||
Pagination
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '隐藏查询条件',
|
||||
tableKey: 0,
|
||||
sids: [],
|
||||
list: [],
|
||||
number: '',
|
||||
listLoading: false,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
params: {
|
||||
createOrgSid: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
manufacturerName: ''
|
||||
},
|
||||
total: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
chooseproducts(this.listQuery).then((response) => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.listQuery.total = response.data.total
|
||||
this.list = response.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置按钮
|
||||
handleReset() {
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.listQuery.params.goodsSpuName = ''
|
||||
this.listQuery.params.goodsSkuCode = ''
|
||||
this.listQuery.params.manufacturerName = ''
|
||||
this.getList()
|
||||
},
|
||||
handleSelectionChange(row) {
|
||||
this.sids = row
|
||||
},
|
||||
showData(value, createOrgSid) {
|
||||
// const aa = []
|
||||
// if (value.length > 0) {
|
||||
// for (var i = 0; i < value.length; i++) {
|
||||
// aa.push(value[i].saleVehSid)
|
||||
// }
|
||||
// this.listQuery.params.saleVehSids = aa
|
||||
// } else {
|
||||
// this.listQuery.params.saleVehSids = []
|
||||
// }``
|
||||
this.listQuery.params.createOrgSid = createOrgSid
|
||||
this.listQuery.current = 1
|
||||
this.listQuery.size = 5
|
||||
this.listQuery.total = 0
|
||||
this.getList()
|
||||
},
|
||||
// 添加修改返回
|
||||
AddUpdateReturn() {
|
||||
if (this.sids.length > 0) {
|
||||
this.$emit('backData', this.sids)
|
||||
} else {
|
||||
this.$notify({ title: '提示', message: '请至少选择一条记录进行操作', type: 'error', duration: 2000 })
|
||||
}
|
||||
},
|
||||
// 返回
|
||||
handleReturn() {
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
435
src/views/reports/inOutStorage/index.vue
Normal file
435
src/views/reports/inOutStorage/index.vue
Normal file
@@ -0,0 +1,435 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="出入库查询" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="商品ID">
|
||||
<el-input v-model="queryParams.params.goodsID" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="queryParams.params.goodsSpuName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-select v-model="queryParams.params.warehouseName" placeholder="请选择" @change='selectWarehouseName'>
|
||||
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-select v-model="queryParams.params.warehouseRackCode" placeholder="请选择"
|
||||
@change='selectWarehouseAreaCode'>
|
||||
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-select v-model="queryParams.params.billObjName" placeholder="请选择" @change='supplierNameSelect'>
|
||||
<el-option v-for="(item,i) in supplierList" :key="i" :label="item.supplierName" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="queryParams.params.batchNumber" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型">
|
||||
<el-select v-model="queryParams.params.billType" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in billTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
|
||||
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间">
|
||||
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>至
|
||||
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
|
||||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">商品出入库列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column fixed prop="goodsID" label="商品ID" align="center" width="120" />
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" width="120" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="120" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="120" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" align="center" width="100" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="120" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="120" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="120" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="120" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" width="150" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="80" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" align="center" width="150" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<!-- <divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/reports/inOutStorage.js'
|
||||
import {
|
||||
choiceSupplierInfo,
|
||||
getOrgSidByPath
|
||||
} from '@/api/Common/dictcommons'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
// import divAdd from './brandsAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
// divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'success',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'build',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"goodsID": "",
|
||||
"billNo": "",
|
||||
"billType": "",
|
||||
"busTypeValue": "",
|
||||
"billObjName": "",
|
||||
"batchNumber": "",
|
||||
"goodsSpuName": "",
|
||||
"goodsSkuCode": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackCode": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
},
|
||||
billTypeList: [{
|
||||
name: "单据类型1",
|
||||
sid: "0"
|
||||
},
|
||||
{
|
||||
name: "单据类型2",
|
||||
sid: "1"
|
||||
}
|
||||
],
|
||||
busTypeList: [{
|
||||
name: "业务类型1",
|
||||
sid: "1"
|
||||
},
|
||||
{
|
||||
name: "业务类型2",
|
||||
sid: "2"
|
||||
}
|
||||
],
|
||||
warehouseList: [],
|
||||
warehouseRackList: [],
|
||||
supplierList: [],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
this.getsupplierLust()
|
||||
this.getWarehouseList()
|
||||
|
||||
|
||||
getOrgSidByPath({
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.createOrgSid = res.data
|
||||
this.formobj.useOrgSid = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
supplierNameSelect(val) {
|
||||
|
||||
console.log("supplierNameSelect", val);
|
||||
const choose = this.supplierList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>supplierNameSelect', choose)
|
||||
this.queryParams.params.billObjName = choose[0].supplierName
|
||||
this.queryParams.params.billObjSid = choose[0].sid
|
||||
|
||||
},
|
||||
getsupplierLust() {
|
||||
// var params = {
|
||||
// createOrgSid: ""
|
||||
// }
|
||||
// req.choiceSupplier(params).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.supplierList = res.data
|
||||
|
||||
// console.log("aaaaaa", this.supplierList);
|
||||
|
||||
// }
|
||||
// })
|
||||
|
||||
choiceSupplierInfo({
|
||||
deptSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage
|
||||
.getItem('defaultOrgPath').lastIndexOf('/') + 1)
|
||||
}).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.supplierList = resp.data
|
||||
console.log("aaaaaa", this.supplierList);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
// choiceSupplierInfo({
|
||||
// orgSid: res.data
|
||||
// }).then((resp) => {
|
||||
// if (resp.success) {
|
||||
// this.supplierList = resp.data
|
||||
// console.log("aaaaaa", this.supplierNameList);
|
||||
// }
|
||||
// })
|
||||
|
||||
},
|
||||
getWarehouseList() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||
}
|
||||
req.getWarehouses(parpams).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getWarehouseAreaList(sid) {
|
||||
var query = {
|
||||
ckSid: sid
|
||||
}
|
||||
req.getWarehouseareas(query).then((res) => {
|
||||
if (res.success) {
|
||||
this.warehouseRackList = res.data
|
||||
|
||||
console.log("aaaaaa", this.warehouseRackList);
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
selectWarehouseName(val) {
|
||||
console.log("selectWarehouseName", val);
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||
this.queryParams.params.warehouseName = choose[0].warehouseName
|
||||
this.queryParams.params.warehouseSid = choose[0].sid
|
||||
|
||||
this.getWarehouseAreaList(choose[0].sid)
|
||||
|
||||
},
|
||||
selectWarehouseAreaCode(val) {
|
||||
console.log("selectWarehouseAreaCode", val);
|
||||
|
||||
const choose = this.warehouseRackList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
|
||||
this.queryParams.params.warehouseRackName = choose[0].areaCode
|
||||
this.queryParams.params.warehouseRackSid = choose[0].sid
|
||||
|
||||
},
|
||||
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
|
||||
},
|
||||
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'build':
|
||||
// this.toBuild()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"goodsID": "",
|
||||
"billNo": "",
|
||||
"billType": "",
|
||||
"busTypeValue": "",
|
||||
"billObjName": "",
|
||||
"batchNumber": "",
|
||||
"goodsSpuName": "",
|
||||
"goodsSkuCode": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackCode": "",
|
||||
"createTimeStart": "",
|
||||
"createTimeEnd": ""
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
|
||||
toBuild() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
|
||||
req.exportExcel(this.queryParams.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库明细_' + this.queryParams.params.createDateStart + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
285
src/views/storage/inventory/inventory.vue
Normal file
285
src/views/storage/inventory/inventory.vue
Normal file
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="库存查询" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<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="商品ID">
|
||||
<el-input v-model="listQuery.params.goodsID" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-input v-model="listQuery.params.warehouseName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input v-model="listQuery.params.warehouseRackCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listQuery.params.batchNumber" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<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>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<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="操作" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toCRK(scope.row)">出入库</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsID" label="商品ID" align="center" width="100" />
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" min-width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" width="100" />
|
||||
<el-table-column prop="count" label="现有库存" align="center" width="100" />
|
||||
<el-table-column prop="allocateCount" label="分配库存" align="center" width="100" />
|
||||
<el-table-column prop="useCount" label="可用库存" align="center" width="100" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="90" />
|
||||
<el-table-column prop="firstInDate" label="首次入库日期" align="center" width="140" />
|
||||
<el-table-column prop="dateAge" label="库龄" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 出入库记录 -->
|
||||
<inventoryRecord v-show="viewState == 2" ref="divCRK" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/storage/inventory'
|
||||
import inventoryRecord from './inventoryRecord'
|
||||
|
||||
export default {
|
||||
name: 'Capital',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar,
|
||||
inventoryRecord
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: '',
|
||||
btnKey: 'toCarry',
|
||||
btnLabel: '结转'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'doExport',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
batchNumber: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toCarry':
|
||||
this.toCarry()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doExport':
|
||||
this.doExport()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
batchNumber: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toCRK(row) {
|
||||
this.viewState = 2
|
||||
this.$refs['divCRK'].showInfo(row)
|
||||
},
|
||||
toCarry() {},
|
||||
doExport() {},
|
||||
doDel() {
|
||||
if (this.sids.length === 0) {
|
||||
this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' })
|
||||
return
|
||||
}
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({ type: 'success', message: resp.msg, showClose: true })
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
67
src/views/storage/inventory/inventoryRecord.vue
Normal file
67
src/views/storage/inventory/inventoryRecord.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">已还与欠款情况</div>
|
||||
<el-table :key="tableKey" :data="formobj.list" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="100" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="100" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="100" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="100" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" min-width="140" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="80" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" align="center" width="160" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/inventory'
|
||||
|
||||
export default {
|
||||
name: 'InventoryRecord',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
formobj: {
|
||||
list: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showInfo(row) {
|
||||
this.viewTitle = row.goodsID + '-' + row.goodsSpuName + '-' + row.goodsSkuCode
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.getWmsInventoryRecordList({ sid: row.sid }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
list: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
262
src/views/storage/inventory/inventoryRefer.vue
Normal file
262
src/views/storage/inventory/inventoryRefer.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="出入库查询" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
||||
<!--Start查询列表部分-->
|
||||
<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="商品ID">
|
||||
<el-input v-model="listQuery.params.goodsID" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="listQuery.params.goodsSpuName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码">
|
||||
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库">
|
||||
<el-input v-model="listQuery.params.warehouseName" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位">
|
||||
<el-input v-model="listQuery.params.warehouseRackCode" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="listQuery.params.batchNumber" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源单号">
|
||||
<el-input v-model="listQuery.params.billNo" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据类型">
|
||||
<el-input v-model="listQuery.params.billType" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-input v-model="listQuery.params.busTypeValue" placeholder="" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发生时间">
|
||||
<el-date-picker v-model="listQuery.params.createTimeStart" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
|
||||
<span style="padding: 0 8px">至</span>
|
||||
<el-date-picker v-model="listQuery.params.createTimeEnd" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<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>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;">
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/>
|
||||
<el-table-column prop="goodsID" label="商品ID" align="center" width="100" />
|
||||
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="100" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="100" />
|
||||
<el-table-column prop="unit" label="单位" align="center" width="80" />
|
||||
<el-table-column prop="warehouseName" label="仓库" min-width="100" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" width="100" />
|
||||
<el-table-column prop="billNo" label="来源单号" align="center" width="100" />
|
||||
<el-table-column prop="createTime" label="发生时间" align="center" width="120" />
|
||||
<el-table-column prop="billType" label="单据类型" align="center" width="100" />
|
||||
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="100" />
|
||||
<el-table-column prop="billObjName" label="客户/供应商" align="center" width="150" />
|
||||
<el-table-column prop="batchNumber" label="批次号" align="center" width="100" />
|
||||
<el-table-column prop="count" label="数量" align="center" width="140" />
|
||||
<el-table-column prop="currentCount" label="出入库后的库存" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit"/>
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/storage/inventory'
|
||||
|
||||
export default {
|
||||
name: 'InventoryRefer',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'export',
|
||||
btnKey: 'doExport',
|
||||
btnLabel: '导出'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
billNo: '',
|
||||
billType: '',
|
||||
busTypeValue: '',
|
||||
billObjName: '',
|
||||
batchNumber: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'doExport':
|
||||
this.doExport()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
req.pageList(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
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 5,
|
||||
total: 0,
|
||||
params: {
|
||||
goodsID: '',
|
||||
billNo: '',
|
||||
billType: '',
|
||||
busTypeValue: '',
|
||||
billObjName: '',
|
||||
batchNumber: '',
|
||||
goodsSpuName: '',
|
||||
goodsSkuCode: '',
|
||||
warehouseName: '',
|
||||
warehouseRackCode: '',
|
||||
createTimeStart: '',
|
||||
createTimeEnd: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
doExport() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.exportExcel(this.listQuery.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库记录' + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
322
src/views/storage/stocktaking/index.vue
Normal file
322
src/views/storage/stocktaking/index.vue
Normal file
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="盘点列表" :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 :inline="true" class="tab-header">
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker v-model="queryParams.params.createDateStart" @change="selectTime1" type="date"
|
||||
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker v-model="queryParams.params.createDateEnd" @change="selectTime2" type="date"
|
||||
placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">盘点列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="createDate" label="单据日期" align="center" />
|
||||
<el-table-column prop="createByName" label="制单人姓名" align="center" />
|
||||
<el-table-column prop="checkStateName" label="盘点状态" align="center" />
|
||||
<el-table-column prop="completeDate" label="完成时间" align="center" />
|
||||
<el-table-column prop="createOrgName" label="门店" align="center" />
|
||||
<el-table-column prop="profitCount" label="盘盈数量" align="center" />
|
||||
<el-table-column prop="profitAmount" label="盘盈金额" align="center" />
|
||||
<el-table-column prop="lossCount" label="盘亏数量" align="center" />
|
||||
<el-table-column prop="lossAmount" label="盈亏金额" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/stocktaking.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './stocktakingAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"createDateStart": "",
|
||||
"createDateEnd": "",
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
selectTime1() {
|
||||
|
||||
},
|
||||
selectTime2() {
|
||||
|
||||
},
|
||||
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
"createDateStart": "",
|
||||
"createDateEnd": "",
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
},
|
||||
toEdit(){
|
||||
if(this.selectionList.length!=1){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(this.selectionList[0].checkState!=1){
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "此记录已完成,不可重复编辑。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toBuild() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
|
||||
req.exportExcel(this.queryParams.params).then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '出入库明细_' + this.queryParams.params.createDateStart + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
412
src/views/storage/stocktaking/stocktakingAdd.vue
Normal file
412
src/views/storage/stocktaking/stocktakingAdd.vue
Normal file
@@ -0,0 +1,412 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="settle()">盘点</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div
|
||||
style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;padding: 10px;">
|
||||
<div>商品列表</div>
|
||||
<div v-if="formobj.billNo!=''">单号:{{formobj.billNo}}</div>
|
||||
</div>
|
||||
|
||||
<el-table :key="commodityKey" :data="formobj.wmsInventoryCheckbillDetailList" :index="index" border
|
||||
style="width: 100%;">
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column align="center" width="70" :render-header="commodityHeader">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="right" width="900" trigger="click">
|
||||
<div>
|
||||
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
|
||||
@current-change="commodityCurrentChange($event, scope.row)">
|
||||
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="goodsSkuOwnSpec" label="型号" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" />
|
||||
<el-table-column prop="warehouseRackCode" label="库位" align="center" />
|
||||
<el-table-column prop="count" label="账面数量" align="center" />
|
||||
</el-table>
|
||||
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
|
||||
layout="total, pager" :total="commodityQuery.total" />
|
||||
</div>
|
||||
<el-input slot="reference" v-model="scope.row.goodsSpuName"
|
||||
@input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="carModel" label="型号" align="center" />
|
||||
<el-table-column prop="unit" label="单位" align="center" />
|
||||
<el-table-column prop="warehouseName" label="仓库" align="center" />
|
||||
<el-table-column prop="warehouseRackCode" label="货位" align="center" />
|
||||
<el-table-column prop="taxPrice" label="单价" align="center" />
|
||||
<el-table-column prop="bookCount" label="账面数量" align="center" />
|
||||
<el-table-column label="实盘数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input ref="focusAssumptionInput" @input="commodityComputeYHAndXSJE(scope.row,$event)"
|
||||
v-model="scope.row.realCount" clearable placeholder=""
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center" width="100" />
|
||||
<el-table-column prop="profitandlossNumber" label="盈亏数" align="center" width="100" />
|
||||
<el-table-column prop="profitandlossAmount" label="盈亏金额" align="center" width="100" />
|
||||
</el-table>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item><span>盘盈数量:{{ profitandNumber }} , 盘盈金额:{{ profitandPrice }} , 盘亏数量:{{ lossNumber }} ,
|
||||
盘库金额:{{ lossPrice }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-form-item><span>备注</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="23">
|
||||
<el-form-item><el-input v-model="formobj.remarks" clearable placeholder="请填写备注..." /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/storage/stocktaking.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
submitdisabled: false,
|
||||
settleVisible: false, //
|
||||
activeNames: '1',
|
||||
index: 0,
|
||||
|
||||
// commodity商品
|
||||
commodityKey: 1,
|
||||
commodityLoading: false,
|
||||
commodityQuery: {
|
||||
current: 1,
|
||||
size: 2,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
commodityData: [],
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"remarks": "",
|
||||
"billNo": "",
|
||||
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||
"createByName":window.sessionStorage.getItem('name'),
|
||||
"createDate": "",
|
||||
"createUserSid": window.sessionStorage.getItem('userSid'),
|
||||
"checkType": "",
|
||||
"profitAmount": "",
|
||||
"lossCount": "",
|
||||
"lossAmount": "",
|
||||
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||
"wmsInventoryCheckbillDetailList": [
|
||||
|
||||
]
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算盘盈数量
|
||||
profitandNumber() {
|
||||
let quantity = 0
|
||||
if (this.formobj.wmsInventoryCheckbillDetailList.length > 0) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) < Number(e.realCount)) {
|
||||
quantity += e.realCount - e.bookCount
|
||||
}
|
||||
})
|
||||
}
|
||||
this.formobj.profitCount = quantity
|
||||
return quantity
|
||||
},
|
||||
// 计算盘盈金额
|
||||
profitandPrice() {
|
||||
let material = 0
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) < Number(e.realCount)) {
|
||||
material += (e.realCount - e.bookCount) * e.taxPrice
|
||||
}
|
||||
})
|
||||
this.formobj.profitAmount = material.toFixed(2)
|
||||
return material.toFixed(2)
|
||||
},
|
||||
// 计算盘亏数量
|
||||
lossNumber() {
|
||||
let quantity = 0
|
||||
if (this.formobj.wmsInventoryCheckbillDetailList.length > 0) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) > Number(e.realCount)) {
|
||||
quantity += e.realCount - e.bookCount
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.formobj.lossCount = quantity
|
||||
|
||||
return quantity
|
||||
},
|
||||
// 计算盘亏金额
|
||||
lossPrice() {
|
||||
let material = 0
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
if (Number(e.bookCount) > Number(e.realCount)) {
|
||||
material += (e.realCount - e.bookCount) * e.taxPrice
|
||||
}
|
||||
})
|
||||
|
||||
this.formobj.lossAmount = material.toFixed(2)
|
||||
|
||||
return material.toFixed(2)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】盘点记录'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
},
|
||||
showEdit(row) {
|
||||
this.viewTitle = '【修改】盘点记录'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.init(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
|
||||
this.formobj.wmsInventoryCheckbillDetailList.forEach((e) => {
|
||||
this.commodityComputeYHAndXSJE(e, e.realCount)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// 在头部标题上添加“新增”图标
|
||||
commodityHeader(h, {
|
||||
column
|
||||
}) {
|
||||
return h(
|
||||
'div',
|
||||
[
|
||||
h('span', column.label),
|
||||
h('i', {
|
||||
class: 'add-btn-icon el-icon-plus',
|
||||
style: 'color: red;font-size:20px',
|
||||
on: {
|
||||
click: this.commodityAdd // 点击执行函数
|
||||
}
|
||||
})
|
||||
]
|
||||
)
|
||||
},
|
||||
commodityAdd() {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.push({
|
||||
"sid": "",
|
||||
"state": "",
|
||||
"billSid": "",
|
||||
"inventorySid": "",
|
||||
"warehouseSid": "",
|
||||
"warehouseName": "",
|
||||
"warehouseRackSid": "",
|
||||
"warehouseRackCode": "",
|
||||
"taxPrice": "",
|
||||
"bookCount": "",
|
||||
"realCount": "",
|
||||
"profitandlossNumber": "",
|
||||
"profitandlossAmount": "",
|
||||
"picUrl": ""
|
||||
})
|
||||
},
|
||||
commodityInput(value) {
|
||||
this.commodityQuery.params.name = value
|
||||
this.commodityLoading = true
|
||||
req.getWarehousesGoods(this.commodityQuery).then((response) => {
|
||||
if (response.success) {
|
||||
this.commodityLoading = false
|
||||
this.commodityData = response.data.records
|
||||
this.commodityQuery.total = response.data.total
|
||||
} else {
|
||||
this.commodityLoading = false
|
||||
this.commodityData = []
|
||||
this.commodityQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
commodityDelete(index) {
|
||||
this.formobj.wmsInventoryCheckbillDetailList.splice(index, 1)
|
||||
},
|
||||
commodityCurrentChange(value, row) {
|
||||
row.sid = value.sid
|
||||
row.goodsName = value.goodsSpuName
|
||||
row.goodsSkuCode = value.goodsSkuCode
|
||||
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
|
||||
row.unit = value.unit
|
||||
row.warehouseName = value.warehouseName
|
||||
row.warehouseSid = value.warehouseSid
|
||||
row.warehouseRackCode = value.warehouseRackCode
|
||||
row.bookCount = value.count
|
||||
row.taxPrice = value.salesPrice
|
||||
row.realCount = ""
|
||||
row.profitandlossNumber = ""
|
||||
row.profitandlossAmount = ""
|
||||
document.body.click()
|
||||
},
|
||||
// 计算状态 盈亏数量 盈亏金额
|
||||
commodityComputeYHAndXSJE(row, val) {
|
||||
|
||||
console.log("aaa", row);
|
||||
console.log("aaa", val);
|
||||
|
||||
// 正常
|
||||
if (Number(row.bookCount) == Number(val)) {
|
||||
row.state = "正常"
|
||||
row.profitandlossNumber = "0"
|
||||
row.profitandlossAmount = "0.00"
|
||||
}
|
||||
|
||||
// 盘盈
|
||||
if (Number(row.bookCount) < Number(val)) {
|
||||
row.state = "盘盈"
|
||||
row.profitandlossNumber = val - row.bookCount
|
||||
row.profitandlossAmount = ((val - row.bookCount) * row.taxPrice).toFixed(2)
|
||||
}
|
||||
|
||||
// 盘亏
|
||||
if (Number(row.bookCount) > Number(val)) {
|
||||
row.state = "盘亏"
|
||||
row.profitandlossNumber = val - row.bookCount
|
||||
row.profitandlossAmount = ((val - row.bookCount) * row.taxPrice).toFixed(2)
|
||||
}
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.save(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
settle() {
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.inven(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '操作成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
confirm() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.settlement(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '结算成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sid": "",
|
||||
"remarks": "",
|
||||
"createBySid": "",
|
||||
"createDate": "",
|
||||
"createUserSid": "",
|
||||
"createByName": "",
|
||||
"checkType": "",
|
||||
"checkState": "",
|
||||
"profitCount": "",
|
||||
"profitAmount": "",
|
||||
"lossCount": "",
|
||||
"lossAmount": "",
|
||||
"useOrgSid": "",
|
||||
"createOrgName": "",
|
||||
"createOrgSid": "",
|
||||
"wmsInventoryCheckbillDetailList": []
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.settleVisible = false
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
</style>
|
||||
248
src/views/system/dictManage/dictCommon.vue
Normal file
248
src/views/system/dictManage/dictCommon.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="14">
|
||||
<el-form-item label="数据value">
|
||||
<el-input v-model="page.params.dictValue" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="onSearch()">查 询</el-button>
|
||||
<el-button @click="add()">添 加</el-button>
|
||||
<el-button @click="closeDict">返 回</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="50px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="primary" size="mini" @click="add(scope.row)">-->
|
||||
<!-- 添加子级-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="primary" size="mini" @click="editRow(scope.row)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleMap(scope.row)">
|
||||
映射
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictType" label="字典分类编码" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="groupName" label="数据分组" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictKey" label="数据key" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictValue" label="数据value" align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
|
||||
<!-- 分类编辑 -->
|
||||
<el-dialog :title="dialogTitle + '字典数据'" :visible.sync="editDialog" width="50%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>字典分类编码</td>
|
||||
<td>
|
||||
{{ form.dictType }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据分组</td>
|
||||
<td>
|
||||
<el-input v-model="form.groupName"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据key</td>
|
||||
<td>
|
||||
<el-input v-model="form.dictKey"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据value</td>
|
||||
<td>
|
||||
<el-input v-model="form.dictValue"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<dictMap v-show="viewState == 2" ref="divAdd" @doback="resetState"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deldictCommon, dictCommonList, putdictCommon, savedictCommon } from '@/api/system/dictType/dictCommon.js'
|
||||
import dictMap from './dictMap'
|
||||
export default {
|
||||
components: {
|
||||
dictMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editDialog: false,
|
||||
dialogTitle: '',
|
||||
viewState: 1,
|
||||
form: {
|
||||
dictKey: '',
|
||||
dictType: '',
|
||||
groupName: '',
|
||||
dictValue: '',
|
||||
parentSid: ''
|
||||
},
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
params: {
|
||||
dictKey: '',
|
||||
dictType: '',
|
||||
dictValue: '',
|
||||
parentSid: '',
|
||||
sidPath: '',
|
||||
}
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
props: ['dictData'],
|
||||
watch: {
|
||||
dictData: {
|
||||
handler(val) {
|
||||
this.form.parentSid = val.sid
|
||||
this.form.dictType = val.dictType
|
||||
this.form.groupName = val.groupName
|
||||
this.page.params.parentSid = val.sid
|
||||
this.page.params.dictType = val.dictType
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// if (this.$route.query.sid) {
|
||||
// sessionStorage.setItem('dictType', this.$route.query.dictType);
|
||||
// sessionStorage.setItem('parentSid', this.$route.query.sid);
|
||||
// this.page.params.dictType = this.$route.query.dictType
|
||||
// this.page.params.parentSid = this.$route.query.sid
|
||||
// this.form.dictType = this.$route.query.dictType;
|
||||
// this.form.parentSid = this.$route.query.sid
|
||||
// } else {
|
||||
// this.page.params.dictType = sessionStorage.getItem('dictType');
|
||||
// this.page.params.parentSid = sessionStorage.getItem('parentSid');
|
||||
// this.form.dictType = sessionStorage.getItem('dictType');
|
||||
// this.form.parentSid = sessionStorage.getItem('parentSid');
|
||||
// }
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
onSearch() { // 查询
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
resetSearch() { // 重置
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
getPageList(data) { // 获取列表
|
||||
dictCommonList(data).then((res) => {
|
||||
this.tableData = res.data.records
|
||||
this.page.total = res.data.total
|
||||
})
|
||||
},
|
||||
add(row) {
|
||||
if (row) {
|
||||
this.form.dictType = row.dictType
|
||||
this.form.parentSid = row.sid
|
||||
} else {
|
||||
this.form.parentSid = 0
|
||||
// this.form.dictType = row.dictType
|
||||
}
|
||||
this.dialogTitle = '新增'
|
||||
this.editDialog = true
|
||||
this.form.dictKey = ''
|
||||
this.form.groupName = ''
|
||||
this.form.dictValue = ''
|
||||
this.form.sid = ''
|
||||
},
|
||||
closeDict() {
|
||||
this.form.parentSid = ''
|
||||
this.form.dictType = ''
|
||||
this.form.groupName = ''
|
||||
this.page.params.parentSid = ''
|
||||
this.page.params.dictType = ''
|
||||
this.$emit('doback')
|
||||
},
|
||||
editRow(row) {
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, row)
|
||||
},
|
||||
save() {
|
||||
if (this.form.sid) {
|
||||
putdictCommon(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
savedictCommon(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(row) {
|
||||
this.$confirm('确定要删除该数据吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deldictCommon({ sid: row.sid }).then(res => {
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
handleMap(row) {
|
||||
this.viewState = 2
|
||||
this.$refs['divAdd'].showAdd(row)
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
200
src/views/system/dictManage/dictManage.vue
Normal file
200
src/views/system/dictManage/dictManage.vue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="分类名称">
|
||||
<el-input clearable v-model="page.params.dictTypeName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="说明">
|
||||
<el-input clearable v-model="page.params.remarks"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="onSearch()">查询</el-button>
|
||||
<el-button @click="add()">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="guanli(scope.row)">
|
||||
管理
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="editRow(scope.row)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictTypeCode" label="字典分类编码" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="dictTypeName" label="字典分类名称" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" label="说明" align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
<!-- 分类编辑 -->
|
||||
<el-dialog :title="dialogTitle + '字典分类'" :visible.sync="editDialog" width="50%">
|
||||
<el-form>
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>数据字典code</td>
|
||||
<td>
|
||||
<el-input v-model="form.dictTypeCode"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>数据分类名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.dictTypeName"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>说明</td>
|
||||
<td>
|
||||
<el-input type="textarea" v-model="form.remarks"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<dict-common @doback="resetState" :dictData='dictData' v-show="viewState == 2"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { pageList, saveDictType, putDictType, delDictType } from '@/api/system/dictType/index.js'
|
||||
import dictCommon from './dictCommon.vue'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editDialog: false,
|
||||
dialogTitle: '',
|
||||
form: {},
|
||||
formBackup: Object.assign({}, this.form),
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
params: {
|
||||
dictTypeName: '',
|
||||
dictTypeCode: ''
|
||||
}
|
||||
},
|
||||
tableData: [],
|
||||
viewState: 1,
|
||||
dictData: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
dictCommon
|
||||
},
|
||||
mounted() {
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
onSearch() { // 查询
|
||||
this.getPageList()
|
||||
},
|
||||
resetSearch() { // 重置
|
||||
this.page.current = 1
|
||||
this.getPageList()
|
||||
},
|
||||
getPageList() { // 获取列表
|
||||
pageList(this.page).then((res) => {
|
||||
if (res.success) {
|
||||
this.tableData = res.data.records
|
||||
this.page.total = res.data.total
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.page.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.dialogTitle = '新增'
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, this.formBackup)
|
||||
},
|
||||
editRow(row) {
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, row)
|
||||
},
|
||||
save() {
|
||||
if (this.form.sid) {
|
||||
putDictType(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
saveDictType(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(row) {
|
||||
this.$confirm('确定要删除该条数据吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delDictType({ sid: row.sid }).then(res => {
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
guanli(row) {
|
||||
this.dictData = { dictType: row.dictTypeCode }
|
||||
this.viewState = 2
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="scoped">
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
155
src/views/system/dictManage/dictMap.vue
Normal file
155
src/views/system/dictManage/dictMap.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div class="app-app-container">
|
||||
<div class="tab-header webtop">
|
||||
<!--标题-->
|
||||
<div>{{ viewTitle }}</div>
|
||||
<!--start 添加修改按钮-->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存
|
||||
</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" class="formadd" :model="formobj">
|
||||
<div class="title">
|
||||
<div>[{{ dictionariesKey }}+{{dictionariesValue}}]映射列表</div>
|
||||
<el-button type="primary" size="mini" @click="Add">添加</el-button>
|
||||
</div>
|
||||
<el-table :key="tableKey" :data="formobj.listDtos" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
|
||||
<el-table-column fixed prop="name" label="操作" width="100px" align="center" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="danger" @click="dataDelete(scope.$index)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="映射来源" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.map_sourceValue" filterable placeholder="" @change="changeSource($event, scope.row)">
|
||||
<el-option v-for="item in mappingsource_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="映射实体名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.map_object" placeholder="" clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="映射项目类别" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.map_item" placeholder="" clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="映射项目编码" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.map_itemKey" placeholder="" clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="映射项目值" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.map_itemValue" placeholder="" clearable/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { typeValues } from '@/api/system/roleAdminister/index'
|
||||
import { saveMappingList, selectMappingListInfo } from '@/api/system/dictType/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return{
|
||||
viewTitle: '数据字典-映射管理',
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
dictionariesKey: '',
|
||||
dictionariesValue: '',
|
||||
mappingsource_list: [],
|
||||
formobj: {
|
||||
userSid: '',
|
||||
dictSid: '',
|
||||
listDtos: []
|
||||
},
|
||||
submitdisabled: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showAdd(row) {
|
||||
this.formobj.dictSid = row.sid
|
||||
this.dictionariesKey = row.dictType
|
||||
this.dictionariesValue = row.dictValue
|
||||
this.formobj.userSid = window.sessionStorage.getItem('userSid')
|
||||
typeValues({ type: 'sys_mappingsource' }).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.mappingsource_list = resp.data
|
||||
}
|
||||
})
|
||||
selectMappingListInfo({ dictSid: row.sid }).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.formobj.listDtos = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
Add() {
|
||||
this.formobj.listDtos.push({
|
||||
map_item: '',
|
||||
map_itemKey: '',
|
||||
map_itemValue: '',
|
||||
map_object: '',
|
||||
map_sourceKey: '',
|
||||
map_sourceValue: '',
|
||||
sid: ''
|
||||
})
|
||||
},
|
||||
changeSource(value, row) {
|
||||
let bb = null
|
||||
this.mappingsource_list.forEach((e) => {
|
||||
if (e.dictValue === value) {
|
||||
bb = {
|
||||
value: e.dictValue,
|
||||
key: e.dictKey
|
||||
}
|
||||
}
|
||||
})
|
||||
row.map_sourceKey = bb.key
|
||||
},
|
||||
dataDelete(index) {
|
||||
this.formobj.listDtos.splice(index, 1)
|
||||
},
|
||||
save() {
|
||||
if (this.formobj.listDtos.length === 0) {
|
||||
this.$message({ showClose: true, type: 'error', message: '映射列表不能为空' })
|
||||
return
|
||||
}
|
||||
saveMappingList(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
||||
this.handleReturn()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
userSid: '',
|
||||
dictSid: '',
|
||||
listDtos: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.title {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
212
src/views/system/logManage/logManage.vue
Normal file
212
src/views/system/logManage/logManage.vue
Normal file
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="tab-header">
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="日志类别">
|
||||
<el-input v-model="page.params.eventName" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="getPageList(page)">查询</el-button>
|
||||
<el-button type="primary" @click="exportExcel" >导出日志</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData" border style="width: 100%;">
|
||||
<el-table-column label="序号" type="index" align="center" width="70px">
|
||||
</el-table-column>
|
||||
<el-table-column prop="eventName" label="日志类别" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="eventContent" label="日志内容" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" label="用户名" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="userIp" label="IP地址" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="timestamp" label="记录时间" align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { logPageList } from '@/api/system/log/index.js'
|
||||
import axios from 'axios'
|
||||
import { getStorage } from '@/utils/auth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radio: '1',
|
||||
dialogVisible: false,
|
||||
disabled: false,
|
||||
form: {},
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
params: {
|
||||
eventName: ''
|
||||
}
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
onSearch() { //查询
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
resetSearch(){ // 重置
|
||||
this.page = this.pageBackup
|
||||
},
|
||||
getPageList(data){ // 获取列表
|
||||
logPageList(data).then((res)=>{
|
||||
this.tableData = res.data.records
|
||||
this.page.total = res.data.total
|
||||
})
|
||||
},
|
||||
exportExcel(){ // 导出文件
|
||||
axios({
|
||||
method: 'get',
|
||||
url: 'api/system/v1/systemlogs/exportLogExcel',
|
||||
params: this.page,
|
||||
responseType: 'blob',
|
||||
headers:{'token': getStorage()}
|
||||
}).then(response => {
|
||||
let blob = new Blob([response.data], {type:"application/vnd.ms-excel"});
|
||||
if (!!window.ActiveXObject || "ActiveXObject" in window) {
|
||||
window.navigator.msSaveOrOpenBlob(blob, '日志');
|
||||
} else {
|
||||
let link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = "日志";
|
||||
link.click();
|
||||
}
|
||||
}).catch((error) => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="scoped" lang="scss">
|
||||
.zcxx {
|
||||
color: #000;
|
||||
width: 98%;
|
||||
margin: 0px auto 30px;
|
||||
background-color: #f7f9fc;
|
||||
border: 1px solid #e6e9f0;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
|
||||
p {
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
margin-top: 0px;
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
float: right;
|
||||
margin-top: 13px;
|
||||
border: none;
|
||||
width: 80px;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
table {
|
||||
width: 98%;
|
||||
margin: 0 auto;
|
||||
|
||||
tr {
|
||||
height: 45px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td:first-child {
|
||||
text-align: right;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
td:nth-child(2) {
|
||||
padding-left: 30px;
|
||||
width: 23%;
|
||||
}
|
||||
|
||||
td:nth-child(3) {
|
||||
text-align: right;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
td:nth-child(4) {
|
||||
padding-left: 30px;
|
||||
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #015bff;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.sfz {
|
||||
border: 1px solid #e6e9f0;
|
||||
width: 45%;
|
||||
|
||||
}
|
||||
|
||||
#bei {
|
||||
width: 21.4%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
line-height: 148px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
576
src/views/system/menuManage/menuManage.vue
Normal file
576
src/views/system/menuManage/menuManage.vue
Normal file
@@ -0,0 +1,576 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="my-tabs" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="菜单列表" name="roleList">
|
||||
<div class="content">
|
||||
<!--<div class="tab-header">-->
|
||||
<!-- <el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="18">
|
||||
<el-form-item label="菜单名称">
|
||||
<el-input v-model="page.params.name" placeholder="菜单名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="资源名称">
|
||||
<!–<el-select v-model="page.sourceSid" @change="$forceUpdate()" :disabled="isadd">
|
||||
<el-option
|
||||
v-for="(item, i) in sourceNameData"
|
||||
:key="i"
|
||||
:label="item.sourceName"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>–>
|
||||
<el-input v-model="page.params.sourceName" placeholder="资源名称" clearable/>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getPageList">查询</el-button>
|
||||
</el-col>-->
|
||||
<!-- <el-col :span="6">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="getSorting">保存排序</el-button>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<!--</el-row>
|
||||
</el-form>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- table -->
|
||||
<div class="table-describe clearfix">
|
||||
<h4 style="color:#000;">菜单列表</h4>
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData" border style="width: 100%;margin-bottom: 100px;" row-key="sid"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column prop="name" label="菜单名称" width="220" />
|
||||
<el-table-column label="操作" width="260" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="add(scope.row)">
|
||||
添加子菜单
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.isSource == '0'" type="primary" size="mini" @click="editRow(scope.row)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.isSource == '0'" type="danger" size="mini"
|
||||
@click.native.prevent="deleteRow(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column prop="sourceName" label="资源名称" align="center"></el-table-column>-->
|
||||
<!-- <el-table-column prop="sortNo" sortable label="排序" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.sortNo" size="mini"/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column prop="pageUrl" label="链接地址" align="center" />
|
||||
<el-table-column prop="isEnable" label="可见性" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
|
||||
inactive-value="0" @change="enabledChange(scope.row.isEnable,scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/> -->
|
||||
<!-- 编辑功能信息 -->
|
||||
<el-dialog :title="dialogTitle + '功能信息'" :visible.sync="editDialog" width="40%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<!-- <tr>
|
||||
<td>上级菜单</td>
|
||||
<td>
|
||||
<el-input v-model="form.pname" :disabled="true" style="width:300px" />
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>资源名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.sourceName" :disabled="true" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单路由</td>
|
||||
<td>
|
||||
<el-input v-model="form.menuUrl" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单图片路径</td>
|
||||
<td>
|
||||
<el-input v-model="form.iconUrl" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>前端页面名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.pageName" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>前端页面路径</td>
|
||||
<td>
|
||||
<el-input v-model="form.pageUrl" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否可见</td>
|
||||
<td>
|
||||
<el-radio-group v-model="form.isShow">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序号</td>
|
||||
<td>
|
||||
<el-input v-model="form.sortNo" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
<el-input v-model="form.remarks" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="新增菜单" name="addrole">
|
||||
<!-- 添加 -->
|
||||
<!--<el-dialog :title="dialogTitle + '菜单管理'" :visible.sync="editDialog" width="40%">-->
|
||||
<table class="e-table" cellspacing="0">
|
||||
<!-- <tr>
|
||||
<td>上级菜单</td>
|
||||
<td>
|
||||
<el-input v-model="form.pname" :disabled="true" style="width:300px" />
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>资源名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.sourceName" :disabled="true" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单路由</td>
|
||||
<td>
|
||||
<el-input v-model="form.menuUrl" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>菜单图片路径</td>
|
||||
<td>
|
||||
<el-input v-model="form.iconUrl" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>前端页面名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.pageName" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>前端页面路径</td>
|
||||
<td>
|
||||
<el-input v-model="form.pageUrl" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否可见</td>
|
||||
<td>
|
||||
<el-radio-group v-model="form.isShow">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
</el-radio-group>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>排序号</td>
|
||||
<td>
|
||||
<el-input v-model="form.sortNo" style="width:300px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
<el-input v-model="form.remarks" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保存</el-button>
|
||||
</div>
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
pageList,
|
||||
menusTreelist,
|
||||
saveMenusInfo,
|
||||
putMenusInfo,
|
||||
delMenus,
|
||||
IsEnable
|
||||
} from '@/api/system/menu/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeName: 'roleList',
|
||||
editDialog: false,
|
||||
dialogTitle: '',
|
||||
checked: '',
|
||||
form: {
|
||||
pname: '顶级菜单',
|
||||
iconUrl: '',
|
||||
isShow: 1,
|
||||
menuName: '',
|
||||
menuUrl: '',
|
||||
pageAliasName: '',
|
||||
pageName: '',
|
||||
pageUrl: '',
|
||||
pageUrlRedirect: '',
|
||||
psid: '',
|
||||
remarks: '',
|
||||
sortNo: 0,
|
||||
sourceName: 'oms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
},
|
||||
formBackup: Object.assign({}, this.form),
|
||||
tableData: [],
|
||||
page: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
psid: '',
|
||||
sourceName: 'oms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
}
|
||||
},
|
||||
rank: '1',
|
||||
sourceNameData: [], // 资源
|
||||
isadd: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getPageList()
|
||||
// this.getsourceList()
|
||||
|
||||
// getsourceList().then(res => {
|
||||
// this.sourceNameData = res.data
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getPageList()
|
||||
},
|
||||
resetSearch() { // 重置
|
||||
this.page.params = this.pageBackup
|
||||
},
|
||||
getPageList() { // 获取列表
|
||||
pageList(this.page).then((res) => {
|
||||
console.log('这里是条件查询', this.page)
|
||||
const treedata = res.data
|
||||
console.log('菜单列表', res)
|
||||
this.tableData = treedata
|
||||
this.page.total = res.data.total
|
||||
})
|
||||
},
|
||||
// 资源名称
|
||||
getsourceList() {
|
||||
const params = {}
|
||||
sourceList(params).then(res => {
|
||||
this.sourceNameData = res.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
this.dialogTitle = '新增'
|
||||
this.roleForm = Object.assign({}, this.formBackup)
|
||||
} else {
|
||||
this.getPageList()
|
||||
}
|
||||
},
|
||||
add(row) {
|
||||
this.activeName = 'addrole'
|
||||
// if(row == 0){
|
||||
// this.isadd = false
|
||||
// }else{
|
||||
// this.isadd = true
|
||||
// }
|
||||
// this.dialogTitle = '新增'
|
||||
// this.editDialog = true
|
||||
this.form = Object.assign({}, this.formBackup)
|
||||
this.form.isShow = 1
|
||||
// this.form.psid = row.sid || 0
|
||||
this.form.pname = row.name || '顶级菜单'
|
||||
this.form.sourceName = row.sourceName
|
||||
this.form.sourceSid = row.sourceSid
|
||||
if (row.isSource == '1') {
|
||||
this.form.psid = 0
|
||||
} else {
|
||||
this.form.psid = row.sid
|
||||
}
|
||||
},
|
||||
editRow(row) {
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, row)
|
||||
this.form.isShow = 1
|
||||
this.form.pname = row.psid == '0' ? '顶级菜单' : row.pname
|
||||
},
|
||||
save() {
|
||||
if (this.form.sid) {
|
||||
putMenusInfo(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
saveMenusInfo(this.form).then(res => {
|
||||
this.activeName = 'roleList'
|
||||
this.getPageList()
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
deleteRow(row) {
|
||||
this.$confirm('确定要删除该菜单吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
delMenus({
|
||||
sid: row.sid
|
||||
}).then(res => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.getPageList(this.page)
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
// 是否可用 按钮
|
||||
enabledChange(value, row) {
|
||||
IsEnable({
|
||||
sid: row.sid,
|
||||
isEnable: value
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
})
|
||||
})
|
||||
},
|
||||
//保存排序
|
||||
getSorting() {
|
||||
|
||||
},
|
||||
retname(sid) {
|
||||
obj = this.sourceNameData.find((item) => {
|
||||
return item.sid == sid // 筛选出匹配数据
|
||||
})
|
||||
return obj.name
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-input__inner {
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped="scoped" lang="scss">
|
||||
.el-pagination.is-background .btn-next,
|
||||
.el-pagination.is-background .btn-prev {
|
||||
padding: 0 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 2px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.el-icon-arrow-left:before,
|
||||
.el-icon-arrow-right:before {
|
||||
content: '下一页';
|
||||
color: #727272;
|
||||
}
|
||||
|
||||
.el-icon-arrow-left:before {
|
||||
content: '上一页';
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.shouye {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: 100px;
|
||||
font-size: 16px;
|
||||
color: #0395d8;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.placename {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: 210px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.right_cont {
|
||||
width: 100%;
|
||||
height: 645px;
|
||||
background-color: #fff;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.cont_head {
|
||||
height: 40px;
|
||||
width: 97%;
|
||||
margin-left: 1.5%;
|
||||
background-color: #f7f9fc;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cont_head p {
|
||||
float: left;
|
||||
color: #000;
|
||||
line-height: 40px;
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.cont_head input {
|
||||
float: left;
|
||||
height: 24px;
|
||||
width: 147px;
|
||||
margin-top: 6px;
|
||||
border: 1px solid #e6e9f0;
|
||||
border-radius: 5px;
|
||||
-webkit-appearance: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.cont_head select {
|
||||
float: left;
|
||||
height: 28px;
|
||||
width: 147px;
|
||||
margin-top: 6px;
|
||||
border: 1px solid #e6e9f0;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.chaxun {
|
||||
height: 28px;
|
||||
width: 85px;
|
||||
line-height: 0px;
|
||||
background-color: #018ad2;
|
||||
margin-top: 6px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
float: right;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.tishi {
|
||||
width: 80%;
|
||||
|
||||
margin: auto;
|
||||
|
||||
tr {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid #e6e9f0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td:first-child {
|
||||
background-color: #f7f9fc;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 80%;
|
||||
height: 30px;
|
||||
border: 1px solid #e6e9f0;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 80%;
|
||||
height: 100px;
|
||||
border: 1px solid #e6e9f0;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 80%;
|
||||
height: 30px;
|
||||
border: 1px solid #e6e9f0;
|
||||
}
|
||||
}
|
||||
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
660
src/views/system/organizationManage/organizationManage.vue
Normal file
660
src/views/system/organizationManage/organizationManage.vue
Normal file
@@ -0,0 +1,660 @@
|
||||
<template>
|
||||
<div class="container" style="display: flex;">
|
||||
<div class="org-tree">
|
||||
<el-tree :data="treedata" node-key="sid" :props="props" :default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" @click.stop.native>
|
||||
<span>{{ node.label || $store.getters.userInfo.Orgname }}</span>
|
||||
<span v-show="data.del" class="handle">
|
||||
<el-tooltip class="item" effect="dark" content="新增" placement="top-start">
|
||||
<el-button type="text" size="mini" @click.stop="() => append(data)" icon="el-icon-circle-plus-outline">
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="修改" placement="top-start">-->
|
||||
<!-- <el-button type="text" size="mini" @click.stop="() => deit(data)" icon="el-icon-edit">-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-tooltip v-show="data.sid" class="item" effect="dark" content="删除" placement="top-start">-->
|
||||
<!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-tooltip>-->
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>组织名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
<td>组织编码</td>
|
||||
<td>
|
||||
<el-input v-model="form.orgCode" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>主管人员</td>
|
||||
<td>
|
||||
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
||||
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid"/>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>分管人员</td>
|
||||
<td>
|
||||
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
||||
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid"/>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织简称</td>
|
||||
<td :colspan="3">
|
||||
<el-input v-model="form.orgAbbre" style="width: 30%"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>管理层级</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>其他编码</td>
|
||||
<td>
|
||||
<el-input v-model="form.otherCode" style="width:300px" placeholder="与财务中客户编码相同"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织地址</td>
|
||||
<td>
|
||||
<el-input v-model="form.addrs" style="width:300px"></el-input>
|
||||
</td>
|
||||
<td>组织属性</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
||||
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织联系人</td>
|
||||
<td>
|
||||
<el-input v-model="form.linkPerson" style="width:300px"></el-input>
|
||||
</td>
|
||||
|
||||
<td>联系电话</td>
|
||||
<td>
|
||||
<el-input v-model="form.linkPhone" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否独立法人</td>
|
||||
<td>
|
||||
<el-radio v-model="form.isDept" :label="0">是</el-radio>
|
||||
<el-radio v-model="form.isDept" :label="1">否</el-radio>
|
||||
</td>
|
||||
<td>排序号</td>
|
||||
<td>
|
||||
<el-input v-model="form.sort" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div slot="footer" class="text-center">
|
||||
<el-button type="primary" @click="nodeSave()">保 存</el-button>
|
||||
<el-button @click="dialogVisible = false">返 回</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div class="org-table" v-show="isshow == 'table'">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="组织名称">
|
||||
<el-input v-model="page.params.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="onSearch()">查询</el-button>
|
||||
<el-button @click="resetSearch()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-table :data="tableData" default-expand-all border style="width: 100%;">
|
||||
<el-table-column label="操作" align="center" width="160px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="editRow(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button type="danger" size="mini" @click.native.prevent="remove(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="组织名称" align="center"></el-table-column>
|
||||
<el-table-column prop="orgCode" label="组织编码" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="zgNames" label="主管" align="center"></el-table-column>-->
|
||||
<el-table-column prop="fgNames" label="分管" align="center"></el-table-column>
|
||||
<!--<el-table-column prop="contactMan" label="联系人" align="center" width="100px"></el-table-column>-->
|
||||
<el-table-column prop="linkPhone" label="联系人手机号" width="110" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="addrs" label="地址" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" align="center" width="50px">
|
||||
</el-table-column>
|
||||
<el-table-column prop="qrText" label="二维码" align="center" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.native.prevent="lookRow(scope.row)" type="text" size="small">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
</div>
|
||||
|
||||
<div class="org-table" v-show="isshow == 'ewm'">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<h4 style="margin: 0;line-height: 32px;">组织二维码</h4>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="Printewm">打 印</el-button>
|
||||
<el-button @click="isshow = 'table'">返 回</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- center -->
|
||||
<div class="ewm" style="display: flex;justify-content: center; align-items: center;" ref="print">
|
||||
<img style="width: 200px; height: 200px;" :src="ewmForm.qrFilePath" alt="">
|
||||
<ul style="list-style:none; line-height: 32px; font-size: 16px;">
|
||||
<li><label>组织名称: </label><span>{{ ewmForm.departmentName }}</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 新增、编辑页面 -->
|
||||
<div class="org-table" v-show="isshow == 'edit'">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<h4 style="margin: 0;line-height: 32px;"> {{ dialogTitle }}组织信息</h4>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="float: right;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="isshow = 'table'">返 回</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- center -->
|
||||
<div class="ediut">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>组织名称</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
<td>组织编码</td>
|
||||
<td>
|
||||
<el-input v-model="form.orgCode" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>主管人员</td>
|
||||
<td>
|
||||
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
||||
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid"/>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>分管人员</td>
|
||||
<td>
|
||||
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
||||
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid"/>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织简称</td>
|
||||
<td :colspan="3">
|
||||
<el-input v-model="form.orgAbbre" style="width: 300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>管理层级</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>其他编码</td>
|
||||
<td>
|
||||
<el-input v-model="form.otherCode" style="width:300px" placeholder="与财务中客户编码相同"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织地址</td>
|
||||
<td>
|
||||
<el-input v-model="form.addrs" style="width:300px"></el-input>
|
||||
</td>
|
||||
<td>组织属性</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
||||
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>组织联系人</td>
|
||||
<td>
|
||||
<el-input v-model="form.linkPerson" style="width:300px"></el-input>
|
||||
</td>
|
||||
<td>联系电话</td>
|
||||
<td>
|
||||
<el-input v-model="form.linkPhone" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否独立法人</td>
|
||||
<td>
|
||||
<el-radio v-model="form.isDept" :label="0">是</el-radio>
|
||||
<el-radio v-model="form.isDept" :label="1">否</el-radio>
|
||||
</td>
|
||||
<td>排序号</td>
|
||||
<td>
|
||||
<el-input v-model="form.sort" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <Position v-if="mapDialog" :address.sync="form.addrs" :maker-position.sync="form.jwd"
|
||||
:dialog-visible.sync="mapDialog"/>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addOrgTree,
|
||||
delOrgtree,
|
||||
getQrCode, getStaff,
|
||||
getStaffName,
|
||||
orgList,
|
||||
pageList,
|
||||
postOrgtree,
|
||||
putOrgtree,
|
||||
selectBySid
|
||||
} from '@/api/system/departments/departments.js'
|
||||
import { typeValues } from '@/api/system/roleAdminister/index'
|
||||
import Position from '@/components/amap/amap.vue'
|
||||
|
||||
export default {
|
||||
components: { Position },
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapDialog: false,
|
||||
dialogTitle: '',
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
nodeForm: {
|
||||
sid: '',
|
||||
name: '',
|
||||
sortNo: ''
|
||||
},
|
||||
ewmForm: {
|
||||
qrFilePath: '',
|
||||
organizationName: '',
|
||||
departmentName: '',
|
||||
address: ''
|
||||
},
|
||||
orgAttribute_list: [],
|
||||
orgLevel_list: [],
|
||||
form: {
|
||||
sid: '',
|
||||
name: '',
|
||||
orgCode: '',
|
||||
/* jwd: '',*/
|
||||
addrs: '',
|
||||
zgStaffSid: '',
|
||||
zgStaffName: '',
|
||||
fgStaffSid: '',
|
||||
fgStaffName: '',
|
||||
linkPerson: '',
|
||||
linkPhone: '',
|
||||
sort: '',
|
||||
isDept: '',
|
||||
orgAbbre: '',
|
||||
orgAttributeValue: '',
|
||||
orgAttributeKey: '',
|
||||
orgLevelValue: '',
|
||||
orgLevelKey: '',
|
||||
otherCode: ''
|
||||
},
|
||||
fgStaffSid: [],
|
||||
formBackup: Object.assign({}, this.form),
|
||||
isshow: 'table',
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
params: {
|
||||
name: '',
|
||||
organizationSid: '',
|
||||
psid: ''
|
||||
}
|
||||
},
|
||||
tableData: [],
|
||||
treedata: [],
|
||||
staffdata: [],
|
||||
staffdata2: [],
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getOrgTree()
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
typeValues({ type: 'orgAttribute' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.orgAttribute_list = res.data
|
||||
}
|
||||
})
|
||||
typeValues({ type: 'orgLevel' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.orgLevel_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
changeOrgLevel(value) {
|
||||
let bb = null
|
||||
this.orgLevel_list.forEach((e) => {
|
||||
if (e.dictValue === value) {
|
||||
bb = {
|
||||
value: e.dictValue,
|
||||
key: e.dictKey
|
||||
}
|
||||
}
|
||||
})
|
||||
this.form.orgLevelValue = bb.value
|
||||
this.form.orgLevelKey = bb.key
|
||||
},
|
||||
changeOrgAttribute(value) {
|
||||
let bb = null
|
||||
this.orgAttribute_list.forEach((e) => {
|
||||
if (e.dictValue === value) {
|
||||
bb = {
|
||||
key: e.dictKey,
|
||||
value: e.dictValue
|
||||
}
|
||||
}
|
||||
})
|
||||
this.form.orgAttributeKey = bb.key
|
||||
},
|
||||
pagination(val) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
this.isshow = 'table'
|
||||
this.page.params.organizationSid = this.$store.getters.userInfo.orgSid
|
||||
this.page.params.psid = data.sid || 0
|
||||
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
getPageList(data) { // 获取树形列表
|
||||
pageList(data).then(res => {
|
||||
console.log('返回子级:',res)
|
||||
this.tableData = res.data.records
|
||||
this.page.total = res.data.total
|
||||
})
|
||||
},
|
||||
getOrgTree() { // 获取树形列表
|
||||
orgList({}).then(res => {
|
||||
this.treedata = res.data
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (this.fgStaffSid.length > 0) {
|
||||
this.form.fgStaffSid = this.fgStaffSid.join()
|
||||
} else {
|
||||
this.form.fgStaffName = ''
|
||||
this.form.fgStaffSid = ''
|
||||
}
|
||||
this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||
// this.form.dlxx = typeof(this.form.dlxx) == 'string' ? this.form.dlxx : this.form.dlxx.join()
|
||||
if (this.form.sid) {
|
||||
// console.log(this.form)
|
||||
putOrgtree(this.form).then(res => {
|
||||
if (res.success) {
|
||||
this.isshow = 'table'
|
||||
this.getOrgTree()
|
||||
this.handleNodeClick({ sid: this.form.psid })
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addOrgTree(this.form).then(res => {
|
||||
if (res.success) {
|
||||
this.isshow = 'table'
|
||||
this.getOrgTree()
|
||||
this.handleNodeClick({ sid: this.form.psid })
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
append(data) {
|
||||
console.log(123456789, data)
|
||||
this.dialogTitle = '新增'
|
||||
this.isshow = 'edit'
|
||||
this.fgStaffSid = []
|
||||
this.form = Object.assign({}, this.formBackup)
|
||||
this.form.psid = data.sid || 0
|
||||
this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||
this.form.address = data.orgAddress || data.address
|
||||
this.form.dlxx = data.gisInfo || data.dlxx
|
||||
this.getStaff(data.sid)
|
||||
this.getStaff2(data.sid)
|
||||
},
|
||||
editRow(row) {
|
||||
this.getStaff(row.sid)
|
||||
this.getStaff2(row.sid)
|
||||
this.dialogTitle = '编辑'
|
||||
this.isshow = 'edit'
|
||||
this.fgStaffSid = []
|
||||
selectBySid(row.sid).then((response) => {
|
||||
if (response.success) {
|
||||
this.form = response.data
|
||||
this.form.fgStaffName = response.data.fgNames
|
||||
this.form.fgStaffSid = response.data.fgStaffSid
|
||||
if (this.form.fgStaffSid) {
|
||||
this.fgStaffSid = response.data.fgStaffSid.split(',')
|
||||
}
|
||||
this.form.zgStaffName = response.data.zgNames
|
||||
this.form.zgStaffSid = response.data.zgStaffSid
|
||||
console.log('编辑回显的数据', this.form)
|
||||
}
|
||||
})
|
||||
},
|
||||
deit(data) { // 节点编辑保存
|
||||
this.getStaff(data.sid)
|
||||
this.getStaff2(data.sid)
|
||||
console.log(data, 8888)
|
||||
this.dialogVisible = true
|
||||
this.form.sid = data.sid
|
||||
// this.form.psid = null
|
||||
this.form.name = data.name
|
||||
this.form.orgCode = data.orgCode
|
||||
/* this.form.jwd = data.jwd*/
|
||||
this.form.addrs = data.addrs
|
||||
this.form.linkPerson = data.linkPerson
|
||||
this.form.linkPhone = data.linkPhone
|
||||
this.form.sort = data.sort
|
||||
this.form.zgStaffSid = data.zgSids
|
||||
this.form.fgStaffSid = data.fgSids.split(',')
|
||||
},
|
||||
nodeSave() { // 节点编辑保存
|
||||
console.log('这是保存nodeSave(0')
|
||||
this.form.fgStaffSid = this.form.fgStaffSid.join()
|
||||
postOrgtree(this.form).then(res => {
|
||||
this.getOrgTree()
|
||||
this.dialogVisible = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
remove(data) {
|
||||
this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delOrgtree({ sid: data.sid }).then(res => {
|
||||
this.getOrgTree()
|
||||
this.handleNodeClick({ sid: data.psid })
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
lookRow(row) { // 查看二维码
|
||||
this.isshow = 'ewm'
|
||||
getQrCode({ sid: row.sid }).then(res => {
|
||||
this.ewmForm = res.data
|
||||
})
|
||||
},
|
||||
Printewm() {
|
||||
this.$print(this.$refs.print) // 使用
|
||||
},
|
||||
mouseenter(data) {
|
||||
this.$set(data, 'del', true)
|
||||
},
|
||||
mouseleave(data) {
|
||||
this.$set(data, 'del', false)
|
||||
},
|
||||
onSearch() {
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
resetSearch() {
|
||||
this.page.params.name = ''
|
||||
this.getPageList(this.page)
|
||||
},
|
||||
// 主管人员
|
||||
getStaff(orgSid) {
|
||||
getStaff({ deptSid: orgSid }).then((res) => {
|
||||
if (res.success) {
|
||||
this.staffdata = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 分管人员
|
||||
getStaff2(orgSid) {
|
||||
getStaffName({ deptSid: orgSid }).then(res => {
|
||||
this.staffdata2 = res.data
|
||||
console.log('分管人员', this.staffdata2)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-icon-arrow-right:before {
|
||||
content: '\e6e0';
|
||||
color: #727272;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped="scoped" lang="scss">
|
||||
.org-tree {
|
||||
width: 240px;
|
||||
min-height: 100%;
|
||||
box-sizing: border-box;
|
||||
/*padding-right: 10px;*/
|
||||
border: 1px solid #edf1f7;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.org-table {
|
||||
flex: 1;
|
||||
// padding-left: 10px;
|
||||
margin: 0 10px;
|
||||
border: 1px solid #edf1f7;
|
||||
min-height: 100%;
|
||||
overflow-y: scroll;
|
||||
|
||||
.ewm {
|
||||
margin: 30px auto 0;
|
||||
width: 560px;
|
||||
}
|
||||
|
||||
.ediut {
|
||||
margin: 30px auto 0;
|
||||
/*width:750px;*/
|
||||
}
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.handle {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
||||
.el-button--text {
|
||||
font-size: 15px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.edit {
|
||||
.el-form-item__label {
|
||||
width: 100px !important;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
.td_left {
|
||||
border-left: 0 solid #e6e9f0;
|
||||
}
|
||||
</style>
|
||||
505
src/views/system/postManage/postManage.vue
Normal file
505
src/views/system/postManage/postManage.vue
Normal file
@@ -0,0 +1,505 @@
|
||||
<template>
|
||||
<el-tabs class="my-tabs" v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="岗位列表" name="roleList">
|
||||
|
||||
<div class="container">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="search" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="岗位名称">
|
||||
<el-input v-model="search.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属部门">
|
||||
<el-select v-model="search.orgSid" placeholder="请选择" clearable @clear="handleClear">
|
||||
<el-option hidden :key="search.orgSid" :label="orgName" :value="search.orgSid"></el-option>
|
||||
<el-tree v-loading="loading" :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId"
|
||||
:default-expand-all='true' :check-strictly='true' :props="defaultProps"
|
||||
@check-change="checkchange"
|
||||
>
|
||||
</el-tree>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-button @click="getList(1)">查询</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-table :data="roleTable" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="editRow(scope.row)" type="primary" size="mini"> 修改</el-button>
|
||||
<el-button @click="delRow(scope.row)" type="danger" size="mini"> 删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="岗位名称" align="center"></el-table-column>
|
||||
<el-table-column prop="parentName" label="上级岗位名称" align="center"></el-table-column>
|
||||
<el-table-column prop="postCode" label="岗位编码" align="center"></el-table-column>
|
||||
<el-table-column prop="postLevel" label="职级" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="orgName" label="所属部门" align="center"></el-table-column> -->
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
|
||||
<!-- 编辑岗位信息 -->
|
||||
<el-dialog :title="dialogTitle + '岗位信息'" :visible.sync="editDialog" width="40%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>上级岗位</td>
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位职级</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.postLevel" @change="changeUPpostLevel" filterable placeholder="请选择" style="width:300px">
|
||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位编码</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.postCode" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<!--<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="roleForm.remarks"></el-input>
|
||||
</td>
|
||||
</tr>-->
|
||||
<!-- <tr>
|
||||
<td>选择部门(单选)</td>
|
||||
<td>
|
||||
<el-tree
|
||||
:data="treedata1"
|
||||
show-checkbox
|
||||
node-key="sid"
|
||||
ref="Tree1"
|
||||
:default-expand-all='true'
|
||||
:check-strictly='true'
|
||||
:default-checked-keys="checkedId1"
|
||||
:props="defaultProps"
|
||||
@check-change="checkchange1"
|
||||
>
|
||||
</el-tree>
|
||||
</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<!-- 新增岗位信息 -->
|
||||
<el-tab-pane label="新增岗位" name="addrole">
|
||||
<el-card class="box-card">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>上级岗位</td>
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位职级</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.postLevel" @change="changePostLevel" filterable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位编码</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.postCode" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<!--<tr>
|
||||
<td>备注</td>
|
||||
<td> <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="roleForm.remarks"></el-input></td>
|
||||
</tr>-->
|
||||
<!-- <tr>
|
||||
<td>选择部门(单选)</td>
|
||||
<td>
|
||||
<el-tree
|
||||
:data="treedata2"
|
||||
show-checkbox
|
||||
node-key="sid"
|
||||
ref="Tree2"
|
||||
:default-expand-all='true'
|
||||
:check-strictly='true'
|
||||
:default-checked-keys="checkedId2"
|
||||
:props="defaultProps"
|
||||
@check-change="checkchange2"
|
||||
>
|
||||
</el-tree>
|
||||
</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {delOrgroles, orgList, pageList, pullDown, putOrgroles, savePost,selectList} from '@/api/system/postManage/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: '',
|
||||
activeName: 'roleList',
|
||||
roleForm: {
|
||||
remarks: "",
|
||||
roleName: "",
|
||||
postCode: '',
|
||||
orgSid: '',
|
||||
postLevel: '',
|
||||
postLevelKey: '',
|
||||
parentSid:''
|
||||
},
|
||||
formBackup: {},
|
||||
search: {
|
||||
name: '',
|
||||
orgSid: ''
|
||||
},
|
||||
orgName: '',
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
},
|
||||
roleTable: [],
|
||||
editDialog: false,
|
||||
// 树形
|
||||
loading: false,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
// orgdata:[], // 部门
|
||||
checkedId: [],
|
||||
checkedId1: [],
|
||||
checkedId2: [],
|
||||
treedata: [],
|
||||
treedata1: [],
|
||||
treedata2: [],
|
||||
postLevelList: [],
|
||||
parentSidList: [],
|
||||
// chace: [],
|
||||
// roleDialog: false,
|
||||
// Thisrow: {},
|
||||
// orgListAll:[]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.formBackup = Object.assign({}, this.roleForm),
|
||||
this.getList()
|
||||
this.getOrgList()
|
||||
this.postLevel()
|
||||
this.getParent()
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页函数
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getList()
|
||||
},
|
||||
// 分页列表
|
||||
getList(flag) {
|
||||
if (flag == '1') {
|
||||
this.page.current = 1
|
||||
}
|
||||
let params = this.page
|
||||
params.params = this.search
|
||||
pageList(params).then(res => {
|
||||
this.page.total = res.data.total
|
||||
this.roleTable = res.data.records
|
||||
})
|
||||
},
|
||||
postLevel(){
|
||||
pullDown({ psid: 0, type: 'postLevel' }).then((res)=>{
|
||||
if(res.code==='200'){
|
||||
this.postLevelList=res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getParent(){
|
||||
selectList().then((res)=>{
|
||||
if(res.code==='200'){
|
||||
this.parentSidList=res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
changePostLevel(value){
|
||||
let bb = null
|
||||
this.postLevelList.forEach((e) => {
|
||||
if (e.dictKey == value) {
|
||||
bb = {
|
||||
name: e.dictValue,
|
||||
value: e.dictKey
|
||||
}
|
||||
}
|
||||
})
|
||||
this.roleForm.postLevel=bb.name
|
||||
this.roleForm.postLevelKey=bb.value
|
||||
},
|
||||
changeUPpostLevel(value){
|
||||
let bb = null
|
||||
this.postLevelList.forEach((e) => {
|
||||
if (e.dictKey == value) {
|
||||
bb = {
|
||||
name: e.dictValue,
|
||||
value: e.dictKey
|
||||
}
|
||||
}
|
||||
})
|
||||
this.roleForm.postLevel=bb.name
|
||||
this.roleForm.postLevelKey=bb.value
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
this.dialogTitle = '新增'
|
||||
this.roleForm = Object.assign({}, this.formBackup)
|
||||
} else {
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
editRow(row) {
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
console.log(row)
|
||||
this.roleForm = Object.assign({}, row)
|
||||
this.checkedId1 = [this.roleForm.orgSid]
|
||||
},
|
||||
delRow(row) {
|
||||
this.$confirm('确定要删除该岗位吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let params = {
|
||||
sids: row.sid
|
||||
}
|
||||
delOrgroles(params).then(res => {
|
||||
this.getList()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存角色
|
||||
save() {
|
||||
if (this.roleForm.sid) {
|
||||
// let orgSid = this.$refs.Tree1.getCheckedKeys()
|
||||
// this.roleForm.orgSid = orgSid.toString()
|
||||
putOrgroles(this.roleForm).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.getList()
|
||||
this.editDialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// let orgSid = this.$refs.Tree2.getCheckedKeys()
|
||||
// this.roleForm.orgSid = orgSid.toString()
|
||||
savePost(this.roleForm).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.getList()
|
||||
this.activeName = "roleList"
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
let arr = []
|
||||
// this.$refs.Tree2.setCheckedKeys(arr);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.roleForm = {
|
||||
remarks: "",
|
||||
roleName: "",
|
||||
orgSid: ''
|
||||
};
|
||||
this.search = {
|
||||
name: '',
|
||||
orgSid: ''
|
||||
}
|
||||
},
|
||||
|
||||
// 获取部门树形
|
||||
getOrgList(row) {
|
||||
this.roleDialog = true
|
||||
this.checkedId = []
|
||||
// this.roleForm.roleName = row.roleName
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {
|
||||
// roleSid: row.sid,
|
||||
// userType: '2'
|
||||
}
|
||||
|
||||
orgList(params).then(res => {
|
||||
this.treedata = res.data
|
||||
this.treedata1 = res.data
|
||||
this.treedata2 = res.data
|
||||
// this.getTreeParentNode(res.data, this.checkedId)
|
||||
// this.getTreeParentid(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
},
|
||||
// // 递归查询所有上级数据
|
||||
// getTreeParentNode(menus, ids) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// if (menus[i].children && menus[i].children.length != 0) {
|
||||
// this.getTreeParentNode(menus[i].children, ids)
|
||||
// } else if (menus[i].isCheck) {
|
||||
// ids.push(menus[i].sid)
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // 所有一级菜单ID
|
||||
// getTreeParentid(menus) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// this.chace.push(menus[i].sid)
|
||||
// }
|
||||
// },
|
||||
// getCheckedKeys() {
|
||||
// let _this = this
|
||||
// let roleMenus = []
|
||||
// this.$refs.Tree.getCheckedKeys().forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||
// for (let i = 0; i < parentTrue.length; i++) {
|
||||
// for (let j = 0; j < this.chace.length; j++) {
|
||||
// if (parentTrue[i] == this.chace[j]) {
|
||||
// parentTrue.splice(i, 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// parentTrue.forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// saveorgrolemenus({
|
||||
// roleSid: _this.Thisrow.sid,
|
||||
// roleMenus: roleMenus
|
||||
// }).then(res => {
|
||||
// this.roleDialog = false
|
||||
// this.$message({
|
||||
// message: res.msg,
|
||||
// type: 'success'
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
|
||||
this.search.orgSid = data.sid
|
||||
this.orgName = data.name
|
||||
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree.setCheckedKeys(arr);
|
||||
return;
|
||||
}
|
||||
},
|
||||
checkchange1(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.roleForm.orgSid = data.sid
|
||||
// this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree1.setCheckedKeys(arr);
|
||||
return;
|
||||
}
|
||||
},
|
||||
checkchange2(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.roleForm.orgSid = data.sid
|
||||
// this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree2.setCheckedKeys(arr);
|
||||
return;
|
||||
}
|
||||
},
|
||||
handleClear() {
|
||||
// 将选择器的值置空
|
||||
this.orgName = ''
|
||||
this.search.orgSid = ''
|
||||
let arr = []
|
||||
this.$refs.Tree.setCheckedKeys(arr);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-select > .el-input {
|
||||
display: block;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
/deep/ .tab-header .el-select {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
977
src/views/system/roleAdminister/roleAdminister.vue
Normal file
977
src/views/system/roleAdminister/roleAdminister.vue
Normal file
@@ -0,0 +1,977 @@
|
||||
<template xmlns="">
|
||||
<div>
|
||||
<el-tabs class="my-tabs" v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="角色列表" name="roleList">
|
||||
<div class="container">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="search" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="search.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-button @click="getroleOrgList(1)">查询</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-table :data="roleTable" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button @click="sourceMenus(scope.row)" type="primary" size="mini">资源授权</el-button> -->
|
||||
<!-- <el-button @click="funMenus(scope.row)" type="primary" size="mini">功能授权</el-button>-->
|
||||
<!-- <el-button @click="roleMenus(scope.row)" type="primary" size="mini">菜单授权</el-button>-->
|
||||
<el-button @click="charactarMenus(scope.row)" type="primary" size="mini">角色授权</el-button>
|
||||
<!-- <el-button @click="mobileMenus(scope.row)" type="primary" size="mini">移动端授权</el-button> -->
|
||||
<el-button @click="editRow(scope.row)" type="primary" size="mini">修改</el-button>
|
||||
<el-button @click="delRow(scope.row)" type="danger" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="角色名称" width="220px" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="角色编码" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="角色排序" align="center">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="postName" label="角色岗位" width="220px" align="center">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="roleTypeValue" label="组织层级" width="200px" align="center">
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="remarks" label="备注" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="isEnableName" label="是否可用" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isEnable"
|
||||
active-value='1'
|
||||
inactive-value='0'
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
@change="enabledChange($event,scope.row)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
||||
|
||||
<!-- 编辑角色信息 -->
|
||||
<el-dialog :title="dialogTitle + '角色信息'" :visible.sync="editDialog" width="40%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<!-- <tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.postSid" filterable style="width:300px" @change="changePost">
|
||||
<el-option
|
||||
v-for="(item, i) in postSidData"
|
||||
:key="i"
|
||||
:label="item.name"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>编码</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.code" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>组织层级</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.roleTypeValue" style="width:300px" @change="changeOrgName">
|
||||
<el-option
|
||||
v-for="(item, i) in roleTypeValue_list"
|
||||
:key="i"
|
||||
:label="item.dictValue"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.sort" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="roleForm.remarks"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 资源授权 -->
|
||||
<el-dialog title="资源授权" :visible.sync="sourceDialog" width="50%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" readonly></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>可操作资源列表</td>
|
||||
<td>
|
||||
<el-tree v-loading="loading" :data="treedata" ref="sourceTree" show-checkbox accordion node-key="sid"
|
||||
:default-expand-all='true'
|
||||
:default-checked-keys="checkedId" :props="sourcedefaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div slot="footer" class="text-center">
|
||||
<el-button type="primary" @click="sourceSave">保 存</el-button>
|
||||
<el-button @click="sourceDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 功能授权 -->
|
||||
<!-- <el-dialog title="功能授权" :visible.sync="funDialog" width="50%">-->
|
||||
<!-- <table class="e-table" cellspacing="0">-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td>角色名称</td>-->
|
||||
<!-- <td>-->
|
||||
<!-- <el-input v-model="roleForm.name" readonly></el-input>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td>可操作功能列表</td>-->
|
||||
<!-- <td>-->
|
||||
<!-- <el-tree v-loading="loading" :data="treedata" ref="funTree" show-checkbox accordion node-key="sid"-->
|
||||
<!-- :default-expand-all='true'-->
|
||||
<!-- :default-checked-keys="checkedId" :props="defaultProps" @check-change="checkchange">-->
|
||||
<!-- </el-tree>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- <div slot="footer" class="text-center">-->
|
||||
<!-- <el-button type="primary" @click="funSave">保 存</el-button>-->
|
||||
<!-- <el-button @click="funDialog = false">关 闭</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!-- 菜单授权 -->
|
||||
<!-- <el-dialog title="菜单授权" :visible.sync="roleDialog" width="50%">-->
|
||||
<!-- <table class="e-table" cellspacing="0">-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td>角色名称</td>-->
|
||||
<!-- <td>-->
|
||||
<!-- <el-input v-model="roleForm.name" readonly></el-input>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td>可操作菜单列表</td>-->
|
||||
<!-- <td>-->
|
||||
<!-- <div style="height:230px;line-height:120px;overflow:auto;overflow-x:hidden;">-->
|
||||
<!-- <el-tree v-loading="loading" :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"-->
|
||||
<!-- :default-expand-all='true'-->
|
||||
<!-- :default-checked-keys="checkedId"-->
|
||||
<!-- :props="defaultProps"-->
|
||||
<!-- @check-change="checkchange">-->
|
||||
<!-- </el-tree>-->
|
||||
<!-- </div>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- <div slot="footer" class="text-center">-->
|
||||
<!-- <el-button type="primary" @click="getCheckedKeys">保 存</el-button>-->
|
||||
<!-- <el-button @click="roleDialog = false">关 闭</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
<el-dialog title="移动端授权" :visible.sync="mobileDialog" width="50%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" readonly></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>可操作菜单列表</td>
|
||||
<td>
|
||||
<div style="height:230px;overflow:auto;overflow-x:hidden;">
|
||||
<el-tree v-loading="loading" :data="treedata" ref="mobileTree" show-checkbox accordion node-key="sid"
|
||||
:default-expand-all="true"
|
||||
:default-checked-keys="checkedId"
|
||||
:props="defaultProps"
|
||||
@check-change="checkchange">
|
||||
</el-tree>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div slot="footer" class="text-center">
|
||||
<el-button type="primary" @click="getCheckedMobile">保 存</el-button>
|
||||
<el-button @click="mobileDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="角色授权" :visible.sync="charactarDialog" width="70%">
|
||||
<el-tabs v-model="charactarName" type="card" style="margin-top: -30px;" @tab-click="handleCharactar">
|
||||
<el-tab-pane label="菜单权限" name="first">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" readonly></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>可操作菜单列表</td>
|
||||
<td>
|
||||
<div style="height:230px;overflow:auto;overflow-x:hidden;">
|
||||
<el-tree v-loading="loading" :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId"
|
||||
:props="defaultProps"
|
||||
@check-change="checkchange">
|
||||
</el-tree>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 10px" class="text-center">
|
||||
<el-button type="primary" @click="getCheckedKeys">保 存</el-button>
|
||||
<el-button @click="charactarDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="功能权限" name="second">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" readonly></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>可操作功能列表</td>
|
||||
<td>
|
||||
<div style="height:230px;line-height:120px;overflow:auto;overflow-x:hidden;">
|
||||
<el-tree v-loading="loading" :data="treedata" ref="funTree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 10px" class="text-center">
|
||||
<el-button type="primary" @click="funSave">保 存</el-button>
|
||||
<el-button @click="charactarDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据权限" name="third">
|
||||
<el-form :model="formobj" class="formadd">
|
||||
<el-row style="border-top: 1px solid #E0E3EB">
|
||||
<el-col :span="6" class="tleftb">
|
||||
<span>角色名称</span>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<span>{{ formobj.name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" class="tleftb">
|
||||
<span>菜单名称名称</span>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.title" clearable placeholder="" style="width: 30%"/>
|
||||
<el-button style="margin-left: 10px" type="primary" size="small" @click="handleSelect">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :key="tableKey" :data="formobj.tableData" :index="index" border style="width: 100%" max-height="300">
|
||||
<el-table-column type="index" label="序号" :index="index + 1" width="80" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="菜单名称" header-align="center" align="left">
|
||||
</el-table-column>
|
||||
<el-table-column label="权限" align="center" width="450">
|
||||
<template slot-scope="scope">
|
||||
<el-radio-group v-model="scope.row.dataRuleId">
|
||||
<el-radio label="1">集团</el-radio>
|
||||
<el-radio label="2">事业部</el-radio>
|
||||
<el-radio label="3">分公司</el-radio>
|
||||
<el-radio label="4">部门</el-radio>
|
||||
<el-radio label="5">个人</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div style="margin-top: 10px" class="text-center">
|
||||
<el-button type="primary" @click="handleSave">保 存</el-button>
|
||||
<el-button @click="charactarDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<!-- 新增角色 -->
|
||||
<el-tab-pane label="新增角色" name="addrole">
|
||||
<el-card class="box-card">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<!-- <tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.postSid" filterable style="width:300px" @change="changePost">
|
||||
<el-option v-for="item in postSidData" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>角色名称</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>编码</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.code" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>组织层级</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.roleTypeValue" style="width:300px" @change="changeOrgName">
|
||||
<el-option v-for="item in roleTypeValue_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>排序</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.sort" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="roleForm.remarks"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
delOrgroles,
|
||||
funMenuTree,
|
||||
postList,
|
||||
putOrgroles,
|
||||
roleMenuTree,
|
||||
roleOrgList,
|
||||
getRoleMenuList,
|
||||
saveRoleMenuList,
|
||||
savefunMenu,
|
||||
saveorgrolemenus,
|
||||
saveOrgroles,
|
||||
saveSource,
|
||||
setRoleEnable,
|
||||
sourceMenuTree,
|
||||
typeValues,
|
||||
selMenuByRole,
|
||||
updateDataByRoleMenu
|
||||
} from '@/api/system/roleAdminister/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: '',
|
||||
activeName: 'roleList',
|
||||
roleForm: {
|
||||
name: '',
|
||||
code: '',
|
||||
sort: '',
|
||||
type: '2',
|
||||
postSid: '',
|
||||
remarks: '',
|
||||
roleType: '',
|
||||
roleTypeValue: '',
|
||||
orgSid: window.sessionStorage.getItem('orgSid')
|
||||
},
|
||||
formBackup: {},
|
||||
search: {
|
||||
name: ''
|
||||
},
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10 // 每页的数据条数
|
||||
},
|
||||
roleTable: [],
|
||||
postSidData: [],
|
||||
roleTypeValue_list: [], // 组织层级
|
||||
editDialog: false,
|
||||
// 树形
|
||||
loading: false,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
checkedId: [], // 菜单授权 已选中
|
||||
treedata: [], // 菜单授权
|
||||
chace: [],
|
||||
roleDialog: false,
|
||||
Thisrow: {},
|
||||
// 资源授权
|
||||
sourceDialog: false,
|
||||
sourcetreedata: [],
|
||||
sourcedefaultProps: {
|
||||
children: 'children',
|
||||
label: 'sourceName'
|
||||
},
|
||||
// 功能授权
|
||||
funDialog: false,
|
||||
// 移动端授权
|
||||
mobileDialog: false,
|
||||
// 角色授权(包含功能权限、菜单权限、数据权限)
|
||||
charactarDialog: false,
|
||||
charactarName: '',
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
formobj: {
|
||||
name: '',
|
||||
title: '',
|
||||
tableData: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.formBackup = Object.assign({}, this.roleForm)
|
||||
this.getroleOrgList()
|
||||
this.getPostList()
|
||||
this.getType()
|
||||
},
|
||||
methods: {
|
||||
pagination(val) { // 分页函数
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getroleOrgList()
|
||||
},
|
||||
getPostList() {
|
||||
postList().then((res) => {
|
||||
if (res.success) {
|
||||
this.postSidData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getType() {
|
||||
typeValues({ type: 'roleType' }).then((res) => {
|
||||
if (res.success) {
|
||||
this.roleTypeValue_list = res.data
|
||||
console.log('下拉框请求组织层级', res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 分页列表
|
||||
getroleOrgList(flag) {
|
||||
if (flag == '1') {
|
||||
this.page.current = 1
|
||||
}
|
||||
let params = this.page
|
||||
params.params = this.search
|
||||
roleOrgList(params).then(res => {
|
||||
this.page.total = res.data.total
|
||||
this.roleTable = res.data.records
|
||||
for (let i = 0; i < this.roleTable.length; i++) {
|
||||
if (this.roleTable[i].isEnable == '1') {
|
||||
this.roleTable[i].isEnableName = '是'
|
||||
} else {
|
||||
this.roleTable[i].isEnableName = '否'
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
changeOrgName(value) {
|
||||
const choosetItem = this.roleTypeValue_list.filter((item) => item.dictValue === value)
|
||||
this.roleForm.roleType = choosetItem[0].dictKey
|
||||
console.log('组织层级', this.roleForm.roleType, this.roleForm.roleTypeValue)
|
||||
},
|
||||
changePost(value) {
|
||||
const choosetItem = this.postSidData.filter((item) => item.sid === value)
|
||||
this.roleForm.name = choosetItem[0].name
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
this.dialogTitle = '新增'
|
||||
this.roleForm = Object.assign({}, this.formBackup)
|
||||
} else {
|
||||
this.getroleOrgList()
|
||||
}
|
||||
},
|
||||
handleCharactar(tab) {
|
||||
if (tab.name === 'first') {
|
||||
this.roleMenus(this.Thisrow)
|
||||
} else if (tab.name === 'second') {
|
||||
this.funMenus(this.Thisrow)
|
||||
} else if (tab.name === 'third') {
|
||||
this.formobj.name = this.Thisrow.name
|
||||
selMenuByRole({ roleSid: this.Thisrow.sid, menuName: this.formobj.title }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.tableData = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSelect() {
|
||||
selMenuByRole({ roleSid: this.Thisrow.sid, menuName: this.formobj.title }).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj.tableData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSave() {
|
||||
updateDataByRoleMenu(this.formobj.tableData).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = {
|
||||
name: '',
|
||||
title: '',
|
||||
tableData: []
|
||||
}
|
||||
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
||||
this.charactarDialog = false
|
||||
}
|
||||
})
|
||||
},
|
||||
editRow(row) {
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
this.roleForm = Object.assign({}, row)
|
||||
},
|
||||
delRow(row) {
|
||||
this.$confirm('确定要删除该角色吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delOrgroles({ sid: row.sid }).then((res) => {
|
||||
if (res.success) {
|
||||
this.getroleOrgList()
|
||||
this.$message({ showClose: true, type: 'success', message: '删除成功!' })
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存角色
|
||||
save() {
|
||||
if (this.roleForm.sid) {
|
||||
putOrgroles(this.roleForm).then((res) => {
|
||||
if (res.success) {
|
||||
this.getroleOrgList()
|
||||
this.editDialog = false
|
||||
this.$message({ showClose: true, message: res.msg, type: 'success' })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
saveOrgroles(this.roleForm).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({ showClose: true, message: res.msg, type: 'success' })
|
||||
this.activeName = 'roleList'
|
||||
this.getroleOrgList()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 是否可用 按钮
|
||||
enabledChange(value, row) {
|
||||
setRoleEnable({
|
||||
sid: row.sid,
|
||||
isEnable: value
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({ showClose: true, type: 'success', message: res.msg })
|
||||
}
|
||||
})
|
||||
},
|
||||
sourceMenus(row) {
|
||||
this.sourceDialog = true
|
||||
this.checkedId = []
|
||||
this.roleForm.name = row.name
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {
|
||||
roleSid: row.sid
|
||||
}
|
||||
sourceMenuTree(params).then(res => {
|
||||
let data1 = res.data
|
||||
for (let i = 0; i < data1.length; i++) {
|
||||
if (data1[i].checked == 0) {
|
||||
this.checkedId.push(data1[i].sid)
|
||||
}
|
||||
}
|
||||
this.treedata = res.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
funMenus(row) {
|
||||
this.funDialog = true
|
||||
this.checkedId = []
|
||||
this.roleForm.name = row.name
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {
|
||||
roleSid: row.sid
|
||||
}
|
||||
funMenuTree(params).then(res => {
|
||||
let data1 = res.data
|
||||
// 如果菜单有子级菜单,说明是父级菜单,父级菜单不可以直接赋值已选中状态
|
||||
for (let i = 0; i < data1.length; i++) {
|
||||
if (data1[i].children) {
|
||||
// data2各模块中的一级菜单
|
||||
let data2 = data1[i].children
|
||||
for (let j = 0; j < data2.length; j++) {
|
||||
// 如果一级菜单有子级菜单(二级菜单),就循环查看二级菜单有无子级菜单
|
||||
if (data2[j].children) {
|
||||
// data3各模块中的二级菜单
|
||||
const data3 = data2[j].children
|
||||
for (let k = 0; k < data3.length; k++) {
|
||||
// 如果二级菜单有子级菜单(三级菜单),就循环查看三级菜单有无子级菜单
|
||||
if (data3[k].children) {
|
||||
const data4 = data3[k].children
|
||||
for (let l = 0; l < data4.length; l++) {
|
||||
if (data4[l].checked == 0) {
|
||||
this.checkedId.push(data4[l].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果二级菜单没有子级菜单(三级菜单),查看是否是选中状态
|
||||
if (data3[k].children.length == 0 && data3[k].checked == 0) {
|
||||
this.checkedId.push(data3[k].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果一级菜单没有子级菜单(二级菜单),查看是否是选中状态
|
||||
if (data2[j].children.length == 0 && data2[j].checked == 0) {
|
||||
this.checkedId.push(data2[j].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < data1.length; i++) {
|
||||
// if (data1[i].checked == 0) {
|
||||
// this.checkedId.push(data1[i].sid)
|
||||
// }
|
||||
// for (let j = 0; j < data1[i].children.length; j++) {
|
||||
// let data2 = data1[i].children
|
||||
// if (data2[j].checked == 0) {
|
||||
// this.checkedId.push(data2[j].sid)
|
||||
// }
|
||||
// for (let k = 0; k < data2[j].children.length; k++) {
|
||||
// let data3 = data2[j].children
|
||||
// if (data3[k].checked == 0) {
|
||||
// this.checkedId.push(data3[k].sid)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
this.treedata = res.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 获取授权菜单树形
|
||||
roleMenus(row) {
|
||||
this.roleDialog = true
|
||||
this.checkedId = []
|
||||
this.roleForm.name = row.name
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {
|
||||
roleSid: row.sid
|
||||
}
|
||||
roleMenuTree(params).then(res => {
|
||||
let data1 = res.data
|
||||
// 如果菜单有子级菜单,说明是父级菜单,父级菜单不可以直接赋值已选中状态
|
||||
for (let i = 0; i < data1.length; i++) {
|
||||
if (data1[i].children) {
|
||||
// data2各模块中的一级菜单
|
||||
let data2 = data1[i].children
|
||||
for (let j = 0; j < data2.length; j++) {
|
||||
// 如果一级菜单有子级菜单(二级菜单),就循环查看二级菜单有无子级菜单
|
||||
if (data2[j].children) {
|
||||
// data3各模块中的二级菜单
|
||||
const data3 = data2[j].children
|
||||
for (let k = 0; k < data3.length; k++) {
|
||||
// 如果二级菜单有子级菜单(三级菜单),就循环查看三级菜单有无子级菜单
|
||||
if (data3[k].children) {
|
||||
const data4 = data3[k].children
|
||||
for (let l = 0; l < data4.length; l++) {
|
||||
if (data4[l].checked == 0) {
|
||||
this.checkedId.push(data4[l].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果二级菜单没有子级菜单(三级菜单),查看是否是选中状态
|
||||
if (data3[k].children.length == 0 && data3[k].checked == 0) {
|
||||
this.checkedId.push(data3[k].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果一级菜单没有子级菜单(二级菜单),查看是否是选中状态
|
||||
if (data2[j].children.length == 0 && data2[j].checked == 0) {
|
||||
this.checkedId.push(data2[j].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < data1.length; i++) {
|
||||
// if (data1[i].checked == 0) {
|
||||
// this.checkedId.push(data1[i].sid)
|
||||
// }
|
||||
// for (let j = 0; j < data1[i].children.length; j++) {
|
||||
// let data2 = data1[i].children
|
||||
// if (data2[j].checked == 0) {
|
||||
// this.checkedId.push(data2[j].sid)
|
||||
// }
|
||||
// for (let k = 0; k < data2[j].children.length; k++) {
|
||||
// let data3 = data2[j].children
|
||||
// if (data3[k].checked == 0) {
|
||||
// this.checkedId.push(data3[k].sid)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
console.log('112233', this.checkedId)
|
||||
this.treedata = res.data
|
||||
this.getTreeParentNode(res.data, this.checkedId)
|
||||
this.getTreeParentid(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
mobileMenus(row) {
|
||||
this.mobileDialog = true
|
||||
this.checkedId = []
|
||||
this.roleForm.name = row.name
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
getRoleMenuList(row.sid).then(res => {
|
||||
let data1 = res.data
|
||||
// 如果菜单有子级菜单,说明是父级菜单,父级菜单不可以直接赋值已选中状态
|
||||
for (let i = 0; i < data1.length; i++) {
|
||||
if (data1[i].children) {
|
||||
// data2各模块中的一级菜单
|
||||
let data2 = data1[i].children
|
||||
for (let j = 0; j < data2.length; j++) {
|
||||
// 如果一级菜单有子级菜单(二级菜单),就循环查看二级菜单有无子级菜单
|
||||
if (data2[j].children) {
|
||||
// data3各模块中的二级菜单
|
||||
const data3 = data2[j].children
|
||||
for (let k = 0; k < data3.length; k++) {
|
||||
// 如果二级菜单有子级菜单(三级菜单),就循环查看三级菜单有无子级菜单
|
||||
if (data3[k].children) {
|
||||
const data4 = data3[k].children
|
||||
for (let l = 0; l < data4.length; l++) {
|
||||
if (data4[l].checked == 0) {
|
||||
this.checkedId.push(data4[l].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果二级菜单没有子级菜单(三级菜单),查看是否是选中状态
|
||||
if (data3[k].children.length == 0 && data3[k].checked == 0) {
|
||||
this.checkedId.push(data3[k].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果一级菜单没有子级菜单(二级菜单),查看是否是选中状态
|
||||
if (data2[j].children.length == 0 && data2[j].checked == 0) {
|
||||
this.checkedId.push(data2[j].sid)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (let i = 0; i < data1.length; i++) {
|
||||
// if (data1[i].checked == 0) {
|
||||
// this.checkedId.push(data1[i].sid)
|
||||
// }
|
||||
// for (let j = 0; j < data1[i].children.length; j++) {
|
||||
// let data2 = data1[i].children
|
||||
// if (data2[j].checked == 0) {
|
||||
// this.checkedId.push(data2[j].sid)
|
||||
// }
|
||||
// for (let k = 0; k < data2[j].children.length; k++) {
|
||||
// let data3 = data2[j].children
|
||||
// if (data3[k].checked == 0) {
|
||||
// this.checkedId.push(data3[k].sid)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
console.log('112233', this.checkedId)
|
||||
this.treedata = res.data
|
||||
this.getTreeParentNode(res.data, this.checkedId)
|
||||
// this.getTreeParentid(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
charactarMenus(row) {
|
||||
this.charactarDialog = true
|
||||
this.charactarName = 'first'
|
||||
this.Thisrow = row
|
||||
this.roleMenus(row)
|
||||
},
|
||||
// 递归查询所有上级数据
|
||||
getTreeParentNode(menus, ids) {
|
||||
for (var i = 0; i < menus.length; i++) {
|
||||
if (menus[i].children && menus[i].children.length !== 0) {
|
||||
this.getTreeParentNode(menus[i].children, ids)
|
||||
} else if (menus[i].isCheck) {
|
||||
ids.push(menus[i].sid)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 所有一级菜单ID
|
||||
getTreeParentid(menus) {
|
||||
for (var i = 0; i < menus.length; i++) {
|
||||
this.chace.push(menus[i].sid)
|
||||
}
|
||||
},
|
||||
// 设置半选状态
|
||||
setHalfCheckedNodes(sid) {
|
||||
const node = this.$refs['Tree'].getNode(sid)
|
||||
console.log('11111', sid)
|
||||
console.log('11111', node)
|
||||
if (node) { // 此处应判断当前节点的checked属性是否为true,是则不必半选
|
||||
node.indeterminate = true
|
||||
}
|
||||
},
|
||||
// 资源授权保存
|
||||
sourceSave() {
|
||||
let sourceMenus = this.$refs.sourceTree.getCheckedKeys()
|
||||
let params = {
|
||||
sorceSid: sourceMenus.toString(),
|
||||
roleSid: this.Thisrow.sid
|
||||
}
|
||||
saveSource(params).then(res => {
|
||||
this.sourceDialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 功能授权保存
|
||||
funSave() {
|
||||
let funMenus = []
|
||||
funMenus = this.$refs.funTree.getCheckedNodes(false, true)
|
||||
// funMenus = this.$refs.Tree.getCheckedKeys()
|
||||
console.log('已选节点、半选节点node', funMenus)
|
||||
const funMenus_sid = []
|
||||
for (var i = 0; i < funMenus.length; i++) {
|
||||
funMenus_sid.push(funMenus[i].sid)
|
||||
}
|
||||
console.log('已选节点、半选节点sid', funMenus_sid)
|
||||
// let funMenus = this.$refs.funTree.getCheckedKeys()
|
||||
// let params = {
|
||||
// functionSid: funMenus.toString(),
|
||||
// roleSid: this.Thisrow.sid
|
||||
// }
|
||||
let params = {
|
||||
functionSid: funMenus_sid.toString(),
|
||||
roleSid: this.Thisrow.sid
|
||||
}
|
||||
savefunMenu(params).then(res => {
|
||||
this.funDialog = false
|
||||
this.charactarDialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 菜单授权
|
||||
getCheckedKeys() {
|
||||
let roleMenus = []
|
||||
roleMenus = this.$refs.Tree.getCheckedNodes(false, true)
|
||||
// roleMenus = this.$refs.Tree.getCheckedKeys()
|
||||
console.log('已选节点、半选节点node', roleMenus)
|
||||
const roleMenus_sid = []
|
||||
for (var i = 0; i < roleMenus.length; i++) {
|
||||
roleMenus_sid.push(roleMenus[i].sid)
|
||||
}
|
||||
console.log('已选节点、半选节点sid', roleMenus_sid)
|
||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||
// for (let i = 0; i < parentTrue.length; i++) {
|
||||
// for (let j = 0; j < this.chace.length; j++) {
|
||||
// if (parentTrue[i] == this.chace[j]) {
|
||||
// parentTrue.splice(i, 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
let params = {
|
||||
menuSid: roleMenus_sid.toString(),
|
||||
roleSid: this.Thisrow.sid,
|
||||
sourceSid:"d936f1ba-03c3-11ec-bf08-48452053aa44"
|
||||
}
|
||||
saveorgrolemenus(params).then(res => {
|
||||
this.roleDialog = false
|
||||
this.charactarDialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
},
|
||||
getCheckedMobile() {
|
||||
let roleMenus = []
|
||||
roleMenus = this.$refs.mobileTree.getCheckedNodes(false, true)
|
||||
// roleMenus = this.$refs.Tree.getCheckedKeys()
|
||||
console.log('已选节点、半选节点node', roleMenus)
|
||||
const roleMenus_sid = []
|
||||
for (var i = 0; i < roleMenus.length; i++) {
|
||||
roleMenus_sid.push(roleMenus[i].sid)
|
||||
}
|
||||
console.log('已选节点、半选节点sid', roleMenus_sid)
|
||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||
// for (let i = 0; i < parentTrue.length; i++) {
|
||||
// for (let j = 0; j < this.chace.length; j++) {
|
||||
// if (parentTrue[i] == this.chace[j]) {
|
||||
// parentTrue.splice(i, 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
let params = {
|
||||
menuSid: roleMenus_sid.toString(),
|
||||
roleSid: this.Thisrow.sid
|
||||
}
|
||||
saveRoleMenuList(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.mobileDialog = false
|
||||
this.$message({ showClose: true, message: res.msg, type: 'success' })
|
||||
}
|
||||
})
|
||||
},
|
||||
checkchange() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
65
src/views/system/userManage/userManage.vue
Normal file
65
src/views/system/userManage/userManage.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs class="my-tabs" v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="用户列表" name="roleList">
|
||||
<user-manage-list :dataObj='dataObj' @status='isShow' @item='listObj'></user-manage-list>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="新增用户" name="addrole">
|
||||
<user-manage-add @status='isShow' :dataObj='childObj'></user-manage-add>
|
||||
</el-tab-pane>-->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import userManageList from './userManageList.vue'
|
||||
import userManageAdd from './userManageAdd.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
userManageList: userManageList,
|
||||
userManageAdd: userManageAdd,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'roleList',
|
||||
editDialog: false,
|
||||
dataObj: {
|
||||
isShow: ''
|
||||
},
|
||||
childObj: {}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
this.dialogTitle = '新增'
|
||||
// this.roleForm = Object.assign({}, this.formBackup)
|
||||
} else {
|
||||
// this.getroleOrgList()
|
||||
}
|
||||
},
|
||||
isShow(val) {
|
||||
if (!val) {
|
||||
this.activeName = 'roleList'
|
||||
this.dataObj.isShow = false
|
||||
this.dataObj.isShow = true
|
||||
} else {
|
||||
this.activeName = 'addrole'
|
||||
}
|
||||
},
|
||||
listObj(val) {
|
||||
this.childObj = val
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped="scoped">
|
||||
.my-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
264
src/views/system/userManage/userManageAdd.vue
Normal file
264
src/views/system/userManage/userManageAdd.vue
Normal file
@@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>姓名</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>用户类型</td>
|
||||
<td>
|
||||
<el-select v-model="form.userType" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>部门</td>
|
||||
<td>
|
||||
<el-select v-model="form.deptSid" placeholder="请选择" style="width:300px">
|
||||
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
|
||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
<!--<el-select v-model="form.deptSid" @change="$forceUpdate()">
|
||||
<el-option
|
||||
v-for="(item, i) in treedata"
|
||||
:key="i"
|
||||
:label="item.name"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--<el-input v-model="form.postSid"></el-input>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td>
|
||||
<el-input v-model="form.mobile" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机验证码</td>
|
||||
<td>
|
||||
<el-input v-model="form.verificationCode" placeholder="请输入验证码" style="width:300px">
|
||||
<el-button v-show="showCode" slot="append" @click.native="getIdentifying">获取验证码</el-button>
|
||||
<el-button v-show="!showCode" slot="append">{{phoneCodeCount}} s</el-button>
|
||||
</el-input>
|
||||
<!--<el-input v-model="form.verificationCode"></el-input>-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<!--<el-button type="warning" @click="cancel()">取 消</el-button>-->
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userAdd,
|
||||
userUpdata,
|
||||
userSingle,
|
||||
orgList,
|
||||
postList,
|
||||
getCode
|
||||
} from '@/api/system/userManage/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
sid: '',
|
||||
name: '',
|
||||
userType: '',
|
||||
deptSid: '',
|
||||
postSid: '',
|
||||
mobile: '',
|
||||
verificationCode: ''
|
||||
},
|
||||
form1: {
|
||||
sid: '',
|
||||
},
|
||||
userTypeData: [{
|
||||
value: '1',
|
||||
name: '员工'
|
||||
}, {
|
||||
value: '2',
|
||||
name: '主管'
|
||||
}, {
|
||||
value: '3',
|
||||
name: '经理'
|
||||
}],
|
||||
treedata: [],
|
||||
checkedId: [],
|
||||
orgName: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
postSidData: [],
|
||||
showCode: true,
|
||||
phoneCodeCount: '',
|
||||
timer: null,
|
||||
};
|
||||
},
|
||||
props: ['dataObj'],
|
||||
watch: {
|
||||
dataObj: {
|
||||
handler(val) {
|
||||
this.form1.sid = val.sid
|
||||
this.getUserSingle()
|
||||
this.getOrgList()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getOrgList()
|
||||
},
|
||||
methods: {
|
||||
getUserSingle() {
|
||||
userSingle(this.form1).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.form.sid = res.data.sid
|
||||
this.form.name = res.data.name
|
||||
this.form.userType = res.data.userType
|
||||
this.form.deptSid = res.data.deptSid
|
||||
this.orgName = res.data.departmentName
|
||||
this.form.postSid = res.data.postSid
|
||||
this.form.mobile = res.data.mobile
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取部门树形
|
||||
getOrgList(row) {
|
||||
// this.roleDialog = true
|
||||
this.checkedId = []
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {}
|
||||
orgList(params).then(res => {
|
||||
this.treedata = res.data
|
||||
})
|
||||
|
||||
},
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
|
||||
this.form.deptSid = data.sid
|
||||
this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree.setCheckedKeys(arr);
|
||||
this.form.postSid = ''
|
||||
this.getPost(data.sid)
|
||||
return;
|
||||
}
|
||||
},
|
||||
getPost(orgSid) {
|
||||
let params = {
|
||||
sid: orgSid
|
||||
}
|
||||
postList(params).then(res => {
|
||||
this.postSidData = res.data
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (this.form.sid) {
|
||||
userUpdata(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.$emit('status', false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let orgSid = this.$refs.Tree.getCheckedKeys()
|
||||
this.form.deptSid = orgSid.toString()
|
||||
userAdd(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.$emit('status', false)
|
||||
}
|
||||
})
|
||||
let arr = []
|
||||
this.$refs.Tree.setCheckedKeys(arr);
|
||||
}
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
sid: '',
|
||||
name: '',
|
||||
userType: '',
|
||||
deptSid: '',
|
||||
postSid: '',
|
||||
mobile: '',
|
||||
verificationCode: ''
|
||||
}
|
||||
},
|
||||
//获取验证码
|
||||
getIdentifying() {
|
||||
if (this.form.mobile == "") {
|
||||
this.$alert('请填写手机号码', '', {
|
||||
confirmButtonText: '确定'
|
||||
})
|
||||
return;
|
||||
}
|
||||
//验证码倒计时
|
||||
const TIME_COUNT = 60;
|
||||
if (!this.timer) {
|
||||
this.phoneCodeCount = TIME_COUNT;
|
||||
this.showCode = false;
|
||||
this.timer = setInterval(() => {
|
||||
if (this.phoneCodeCount > 0 && this.phoneCodeCount <= TIME_COUNT) {
|
||||
this.phoneCodeCount--;
|
||||
} else {
|
||||
this.showCode = true;
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
let obj = {
|
||||
phone: this.form.mobile,
|
||||
}
|
||||
getCode(obj).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.orginTranceNo = res.data.tranceNo;
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$emit('status', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
504
src/views/system/userManage/userManageList.vue
Normal file
504
src/views/system/userManage/userManageList.vue
Normal file
@@ -0,0 +1,504 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="page.params" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="page.params.userName" clearable></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="姓名">
|
||||
<el-input v-model="search.name" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="page.params.roleSid" filterable clearable placeholder="请选择">
|
||||
<el-option v-for="item in roleListAll" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="部门"> -->
|
||||
<!-- <el-input v-model="page.params.orgName" clearable></el-input> -->
|
||||
<!-- <el-select v-model="search.roleSid" clearable placeholder="请选择">-->
|
||||
<!-- <el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item> -->
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="getOrgUserList(1)">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-table :data="userTable" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="setRole(scope.row)" type="primary" size="mini">
|
||||
设置角色
|
||||
</el-button>
|
||||
<el-button @click="initPwd(scope.row)" type="danger" size="mini">
|
||||
初始化密码
|
||||
</el-button>
|
||||
<!-- <el-button @click="del(scope.row)" type="danger" size="mini">
|
||||
删除
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" label="用户名" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <span class="tablerow-click" @click="userinfoChange(scope.row)">{{ scope.row.userName }}</span> -->
|
||||
{{ scope.row.userName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userType" label="用户类型" align="center"></el-table-column>
|
||||
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="departmentName" label="部门" align="center"></el-table-column> -->
|
||||
<!-- <el-table-column prop="postName" label="岗位" align="center"></el-table-column> -->
|
||||
<el-table-column prop="isEnable" label="是否可用" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-value='1' inactive-value='0' active-color="#13ce66"
|
||||
inactive-color="#ff4949" @change="enabledChange($event,scope.row)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
||||
<!-- 角色设置 -->
|
||||
<el-dialog title="设置角色" :visible.sync="roleDialog" width="30%">
|
||||
<el-form :model="roleForm" :rules="rules" ref="roleForm">
|
||||
<el-form-item label="角色名称" :label-width="formLabelWidth" prop="roleSid">
|
||||
<el-select v-model="roleForm.roleSid" placeholder="请选择" filterable multiple>
|
||||
<el-option v-for="(item,i) in roleList" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
<!--<el-button type="primary" size='mini' @click="toNav('RoleAdminister')" style="margin-left: 10px;" circle icon="el-icon-plus"></el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveRole('roleForm')">保 存</el-button>
|
||||
<el-button @click="roleDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 部门设置 -->
|
||||
<el-dialog title="部门设置" :visible.sync="bm_Dialog" width="30%">
|
||||
<el-form :model="bm_Form" :rules="rules" ref="bm_Form">
|
||||
<el-form-item label="部门名称" :label-width="formLabelWidth" prop="departmentSid">
|
||||
<!-- <el-select v-model="bm_Form.departmentSid" placeholder="请选择">
|
||||
<el-option v-for="item in bm_List"
|
||||
:key="item.departmentSid"
|
||||
:label="item.departmentName"
|
||||
:value="item.departmentSid"
|
||||
></el-option>
|
||||
</el-select> -->
|
||||
<el-cascader v-model="bm_Form.departmentSid" :options="treedata" :props="props"></el-cascader>
|
||||
<el-button type="primary" size='mini' @click="toNav('deptManage')" style="margin-left: 10px;" circle
|
||||
icon="el-icon-plus"></el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveOrg('bm_Form')">保 存</el-button>
|
||||
<el-button @click="bm_Dialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑信息 -->
|
||||
<el-dialog title="编辑用户信息" :visible.sync="editDialog" width="40%">
|
||||
<table class="e-table" cellspacing="0" style="margin-top: -30px;">
|
||||
<tr>
|
||||
<td>姓名</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>用户类型</td>
|
||||
<td>
|
||||
<el-select v-model="form.userTypeKey" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>部门</td>
|
||||
<td>
|
||||
<el-select v-model="form.deptSid" placeholder="请选择" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
|
||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<!-- <tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td>
|
||||
<el-input v-model="form.userName" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>手机验证码</td>
|
||||
<td>
|
||||
<el-input v-model="form.verificationCode" placeholder="请输入验证码" style="width:300px">
|
||||
<el-button v-show="showCode" slot="append" @click.native="getIdentifying">获取验证码</el-button>
|
||||
<el-button v-show="!showCode" slot="append">{{ phoneCodeCount }} s</el-button>
|
||||
</el-input>
|
||||
</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userList,
|
||||
delUser,
|
||||
initPwd,
|
||||
setRole,
|
||||
orgList,
|
||||
postList,
|
||||
saveOrgRole,
|
||||
roleList,
|
||||
setRoleEnable,
|
||||
userUpdata
|
||||
} from '@/api/system/userManage/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editDialog: false,
|
||||
form: {},
|
||||
userTypeData: [{
|
||||
value: '1',
|
||||
name: '员工'
|
||||
}, {
|
||||
value: '2',
|
||||
name: '主管'
|
||||
}, {
|
||||
value: '3',
|
||||
name: '经理'
|
||||
}],
|
||||
checkedId: [],
|
||||
orgName: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
showCode: true,
|
||||
postSidData: [],
|
||||
phoneCodeCount: '',
|
||||
roleListAll: [],
|
||||
props: {
|
||||
value: 'sid',
|
||||
label: 'name',
|
||||
children: 'orgDepartmentVoList'
|
||||
},
|
||||
treedata: null,
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
params: {
|
||||
name: '',
|
||||
userName: '',
|
||||
roleSid: '',
|
||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
|
||||
},
|
||||
},
|
||||
userTable: [],
|
||||
// 设置角色
|
||||
formLabelWidth: '100',
|
||||
roleDialog: false,
|
||||
roleList: [],
|
||||
roleForm: {
|
||||
roleSid: '',
|
||||
userSid: ''
|
||||
},
|
||||
// 部门
|
||||
bm_Dialog: false,
|
||||
postSid: '',
|
||||
bm_Form: {
|
||||
departmentSid: ''
|
||||
},
|
||||
bm_List: [],
|
||||
rules: {
|
||||
roleSid: [{
|
||||
required: true,
|
||||
message: '请选择角色名称',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
departmentSid: [{
|
||||
required: true,
|
||||
message: '请选择部门名称',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
props: ['dataObj'],
|
||||
watch: {
|
||||
dataObj: {
|
||||
handler(val) {
|
||||
this.getOrgUserList()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getOrgUserList()
|
||||
this.getRoleList()
|
||||
this.getOrgTree()
|
||||
this.getOrgList()
|
||||
},
|
||||
methods: {
|
||||
// 列表 + 初始化
|
||||
getOrgUserList() {
|
||||
userList(this.page).then(res => {
|
||||
this.page.total = res.data.total
|
||||
this.userTable = res.data.records
|
||||
})
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.page = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
userName: '',
|
||||
roleSid: '',
|
||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
|
||||
},
|
||||
}
|
||||
this.getOrgUserList()
|
||||
},
|
||||
getRoleList() {
|
||||
var param = {}
|
||||
roleList(param).then(res => {
|
||||
if (res.code === '200') {
|
||||
this.roleListAll = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
pagination(val) {
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
this.getOrgUserList()
|
||||
},
|
||||
getOrgTree() { // 获取部门树形列表
|
||||
function treeArr(data) {
|
||||
if (data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data[i].orgDepartmentVoList.length > 0) {
|
||||
treeArr(data[i].orgDepartmentVoList)
|
||||
} else {
|
||||
delete data[i].orgDepartmentVoList
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// getOrgTree({organizationSid: this.$store.getters.userInfo.orgSid}).then(res => {
|
||||
// let tree = res.data[0].orgDepartmentVoList
|
||||
// treeArr(tree)
|
||||
// this.treedata = tree
|
||||
// })
|
||||
},
|
||||
// 设置角色 设置 用户ID
|
||||
setRole(row) {
|
||||
this.roleForm.roleSid = []
|
||||
this.roleDialog = true
|
||||
this.roleForm.sid = row.sid
|
||||
this.roleForm.userSid = row.sid
|
||||
setRole(this.roleForm).then(res => {
|
||||
this.roleList = res.data
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
if (res.data[i].checked === '0') {
|
||||
this.roleForm.roleSid.push(res.data[i].sid)
|
||||
}
|
||||
}
|
||||
// this.roleForm.roleSid = res.data.filter(item=> item.checked =='0')
|
||||
})
|
||||
},
|
||||
// 设置角色 提交
|
||||
saveRole(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.roleForm.roleSid = this.roleForm.roleSid.toString()
|
||||
saveOrgRole(this.roleForm).then(res => {
|
||||
if (res.code === '200') {
|
||||
this.roleDialog = false
|
||||
this.getOrgUserList()
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 设置部门 提交
|
||||
saveOrg(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let params = { // 请求的参数
|
||||
departmentSid: this.bm_Form.departmentSid[this.bm_Form.departmentSid.length - 1],
|
||||
staffSid: this.bm_Form.staffSid
|
||||
}
|
||||
saveDepartment(params).then(res => {
|
||||
if (res.code === '200') {
|
||||
this.getOrgUserList()
|
||||
this.bm_Dialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置部门 提交
|
||||
save(formName) {
|
||||
this.form.userType = this.form.userTypeKey;
|
||||
userUpdata(this.form).then(res => {
|
||||
if (res.code === '200') {
|
||||
this.getOrgUserList()
|
||||
this.bm_Dialog = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.editDialog = false
|
||||
}
|
||||
this.reset()
|
||||
})
|
||||
},
|
||||
initPwd(row) {
|
||||
this.$confirm('此操作将初始化该用户密码, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
initPwd({
|
||||
sid: row.sid
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
// 修改用户信息
|
||||
userinfoChange(row) {
|
||||
var postSid = row.postSid
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, row)
|
||||
this.postSid = postSid
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.Tree.setChecked(this.form.departmentSid, true, true)
|
||||
// })
|
||||
// this.$emit('status',true)
|
||||
// this.$emit('item',row)
|
||||
},
|
||||
// 删除
|
||||
del(row) {
|
||||
this.$confirm('此操作将删除该用户, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delUser({
|
||||
sid: row.sid
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
});
|
||||
this.getOrgUserList()
|
||||
})
|
||||
})
|
||||
},
|
||||
toNav(src) {
|
||||
this.$router.push('/' + src)
|
||||
},
|
||||
// 获取部门树形
|
||||
getOrgList(row) {
|
||||
// this.roleDialog = true
|
||||
this.checkedId = []
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {}
|
||||
orgList(params).then(res => {
|
||||
this.treedata = res.data
|
||||
})
|
||||
|
||||
},
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.form.deptSid = data.sid
|
||||
this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid]
|
||||
this.$refs.Tree.setCheckedKeys(arr)
|
||||
this.form.postSid = ''
|
||||
this.getPost(data.sid)
|
||||
return
|
||||
}
|
||||
},
|
||||
getPost(orgSid) {
|
||||
let params = {
|
||||
sid: orgSid
|
||||
}
|
||||
postList(params).then(res => {
|
||||
this.postSidData = res.data
|
||||
})
|
||||
this.form.postSid = this.postSid
|
||||
},
|
||||
reset() {
|
||||
this.form = {}
|
||||
},
|
||||
enabledChange(value, row) {
|
||||
setRoleEnable({
|
||||
sid: row.sid,
|
||||
isEnable: value
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped="scoped">
|
||||
.el-select>.el-input {
|
||||
display: block;
|
||||
width: 300px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user